Documentation ¶
Index ¶
- Constants
- Variables
- func CreateAggregate(ctx context.Context, pool *pgxpool.Pool)
- func CreateProjection(ctx context.Context, pool *pgxpool.Pool)
- func CreateQuery(ctx context.Context, pool *pgxpool.Pool)
- func CreateReadModelProjection(ctx context.Context, pool *pgxpool.Pool)
- func Logger(_ context.Context, event eventstore.DomainEvent) (eventstore.DomainEvent, error)
- func Transform(_ context.Context, event eventstore.DomainEvent) (eventstore.DomainEvent, error)
- type BarEvent
- type FooAggregate
- type FooEvent
- type FooReadModel
- func (f *FooReadModel) Delete(ctx context.Context) error
- func (f *FooReadModel) Init(ctx context.Context) error
- func (f *FooReadModel) IsInitialized(ctx context.Context) (bool, error)
- func (f *FooReadModel) Persist(ctx context.Context) error
- func (f *FooReadModel) Reset(ctx context.Context) error
- func (f *FooReadModel) Stack(method string, args ...map[string]interface{})
- type FooRepository
Constants ¶
View Source
const ( DatabaseURL = "postgres://user:password@localhost/event-store?sslmode=disable" FooStream = "foo-stream" FooEventName = "FooEvent" BarEventName = "BarEvent" )
View Source
const FooReadmodelTable = "app_foo"
Variables ¶
View Source
var ErrFooNotFound = errors.New("Foo not found")
Functions ¶
func Logger ¶
func Logger(_ context.Context, event eventstore.DomainEvent) (eventstore.DomainEvent, error)
func Transform ¶
func Transform(_ context.Context, event eventstore.DomainEvent) (eventstore.DomainEvent, error)
Types ¶
type FooAggregate ¶
type FooAggregate struct { eventstore.BaseAggregate Foo string }
func NewFooAggregate ¶
func NewFooAggregate() *FooAggregate
func NewFooAggregateFromHistory ¶
func NewFooAggregateFromHistory(events eventstore.DomainEventIterator) *FooAggregate
func (*FooAggregate) WhenFooEvent ¶
func (f *FooAggregate) WhenFooEvent(e FooEvent)
type FooReadModel ¶
type FooReadModel struct {
// contains filtered or unexported fields
}
func NewFooReadModel ¶
func NewFooReadModel(client *pg.Client) *FooReadModel
func (*FooReadModel) IsInitialized ¶
func (f *FooReadModel) IsInitialized(ctx context.Context) (bool, error)
func (*FooReadModel) Stack ¶
func (f *FooReadModel) Stack(method string, args ...map[string]interface{})
type FooRepository ¶
type FooRepository struct {
// contains filtered or unexported fields
}
func NewFooRepository ¶
func NewFooRepository(streamName string, eventStore *eventstore.EventStore) *FooRepository
func (FooRepository) Get ¶
func (r FooRepository) Get(ctx context.Context, fooID uuid.UUID) (*FooAggregate, error)
func (FooRepository) Save ¶
func (r FooRepository) Save(ctx context.Context, foo *FooAggregate) error
Click to show internal directories.
Click to hide internal directories.