Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AggregateType ¶
Types ¶
type Aggregate ¶
type Aggregate interface {
ID() ID
}
Aggregate defines the base aggregate operations.
type Record ¶
type Record struct {
// Version contains the version associated with the serialized event
Version int32
// Data contains the event in serialized form
Data json.RawMessage
}
Record provides the serialized representation of the event
type Store ¶
type Store interface {
// Save the provided serialized records to the store
Save(ctx context.Context, aggregate Aggregate, records ...Record) error
// Load the stream of events up to the version specified.
// When toVersion is 0, all events will be loaded.
// To start at the beginning, fromVersion should be set to 0
// fromVersion and toVersion values are inclusive
Load(ctx context.Context, aggregateID ID, fromVersion, toVersion int32) (Stream, error)
}
Store provides an abstraction for the Repository to save data
Click to show internal directories.
Click to hide internal directories.