event_store

package
v0.0.0-...-36d8597 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Billing Service. Infrastructure layer

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventStore

type EventStore interface {
	Init(ctx context.Context, db *db.Store) error

	Save(ctx context.Context, events []*eventsourcing.Event) error
	SafeSave(ctx context.Context, events []*eventsourcing.Event) error
	Load(ctx context.Context, aggregateID string) (*eventsourcing.Snapshot, []*eventsourcing.Event, error)

	GetAggregateWithoutSnapshot(ctx context.Context) ([]*eventsourcing.BaseAggregate, error)
	SaveSnapshot(ctx context.Context, snapshot *eventsourcing.Snapshot) error
}

EventStore saves the events from an aggregate

type Repository

type Repository struct {

	// Base interface
	EventStore

	// Observer interface for subscribe on system event
	notify.Subscriber // Observer interface for subscribe on system event
	// contains filtered or unexported fields
}

Store abstract type

func (*Repository) Use

func (s *Repository) Use(ctx context.Context, log logger.Logger, db *db.Store) (*Repository, error)

Use return implementation of db

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL