Documentation ¶
Index ¶
- func LoadEvent(v interface{}, event ddd.AggregateEvent) error
- func LoadSnapshot(v interface{}, snapshot Snapshot, version int) error
- func SetVersion(version int) registry.BuildOption
- type Aggregate
- type AggregateRepository
- type AggregateStore
- type AggregateStoreMiddleware
- type EventApplier
- type EventCommitter
- type EventPublisher
- type EventSourcedAggregate
- type Snapshot
- type SnapshotApplier
- type Snapshotter
- type VersionSetter
- type Versioner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadEvent ¶
func LoadEvent(v interface{}, event ddd.AggregateEvent) error
func LoadSnapshot ¶
func SetVersion ¶
func SetVersion(version int) registry.BuildOption
Types ¶
type Aggregate ¶
func NewAggregate ¶
func (*Aggregate) AddEvent ¶
func (a *Aggregate) AddEvent(name string, payload ddd.EventPayload, options ...ddd.EventOption)
func (*Aggregate) CommitEvents ¶
func (a *Aggregate) CommitEvents()
func (Aggregate) PendingVersion ¶
type AggregateRepository ¶
type AggregateRepository[T EventSourcedAggregate] struct { // contains filtered or unexported fields }
func NewAggregateRepository ¶
func NewAggregateRepository[T EventSourcedAggregate](aggregateName string, registry registry.Registry, store AggregateStore) AggregateRepository[T]
type AggregateStore ¶
type AggregateStore interface { Load(ctx context.Context, aggregate EventSourcedAggregate) error Save(ctx context.Context, aggregate EventSourcedAggregate) error }
func AggregateStoreWithMiddleware ¶
func AggregateStoreWithMiddleware(store AggregateStore, mws ...AggregateStoreMiddleware) AggregateStore
type AggregateStoreMiddleware ¶
type AggregateStoreMiddleware func(store AggregateStore) AggregateStore
func NewEventPublisher ¶
func NewEventPublisher(publisher ddd.EventPublisher[ddd.AggregateEvent]) AggregateStoreMiddleware
type EventApplier ¶
type EventCommitter ¶
type EventCommitter interface {
CommitEvents()
}
type EventPublisher ¶
type EventPublisher struct { AggregateStore // contains filtered or unexported fields }
func (EventPublisher) Save ¶
func (p EventPublisher) Save(ctx context.Context, aggregate EventSourcedAggregate) error
type EventSourcedAggregate ¶
type EventSourcedAggregate interface { ddd.IDer AggregateName() string ddd.Eventer Versioner EventApplier EventCommitter }
type SnapshotApplier ¶
type Snapshotter ¶
type Snapshotter interface { SnapshotApplier ToSnapshot() Snapshot }
type VersionSetter ¶
type VersionSetter interface {
// contains filtered or unexported methods
}
Click to show internal directories.
Click to hide internal directories.