Documentation ¶
Index ¶
Constants ¶
View Source
const (
// FooAggregate is the aggregate name for Foo.
FooAggregate = "foo"
)
Variables ¶
This section is empty.
Functions ¶
func NewAggregate ¶
NewAggregate returns a new test aggregate.
Types ¶
type AggregateOption ¶
type AggregateOption func(*testAggregate)
AggregateOption is an option for a test Aggregate.
func ApplyEventFunc ¶
func ApplyEventFunc(eventName string, fn func(event.Event)) AggregateOption
ApplyEventFunc returns an AggregateOption that allows users to intercept calls to a.ApplyEvent.
func CommitFunc ¶
func CommitFunc(fn func(flush func())) AggregateOption
CommitFunc returns an AggregateOption that allows users to intercept a.Commit calls. fn accepts a flush() function that can be called to actually flush the changes.
func TrackChangeFunc ¶
func TrackChangeFunc(fn func(changes []event.Event, track func(...event.Event))) AggregateOption
TrackChangeFunc returns an AggregateOption that allows users to intercept calls to a.TrackChange.
type Foo ¶
type Foo struct {
// contains filtered or unexported fields
}
Foo is an example Aggregate used for testing.
func (*Foo) ApplyEvent ¶
func (*Foo) TrackChange ¶
Click to show internal directories.
Click to hide internal directories.