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 RecordChangeFunc ¶ added in v0.1.2
func RecordChangeFunc(fn func(changes []event.Event, track func(...event.Event))) AggregateOption
RecordChangeFunc returns an aggregateOption that allows users to intercept calls to a.RecordChange.
type Foo ¶
type Foo struct {
// contains filtered or unexported fields
}
Foo is an example aggregate used for testing.
func (*Foo) ApplyEvent ¶
func (*Foo) RecordChange ¶ added in v0.1.2
Click to show internal directories.
Click to hide internal directories.