Documentation ¶
Index ¶
- func Config() cqrs.EventConfig
- func MatchAggregate(typ cqrs.AggregateType, id uuid.UUID) cqrs.EventMatcher
- func MatchAggregateID(id uuid.UUID) cqrs.EventMatcher
- func MatchAggregateType(typ cqrs.AggregateType) cqrs.EventMatcher
- func MatchMaxVersion(maxVersion int) cqrs.EventMatcher
- func MatchMinVersion(minVersion int) cqrs.EventMatcher
- func MatchType(typ cqrs.EventType) cqrs.EventMatcher
- func MatchVersion(version int) cqrs.EventMatcher
- func New(typ cqrs.EventType, data cqrs.EventData) cqrs.Event
- func NewAggregateEvent(typ cqrs.EventType, data cqrs.EventData, aggregateType cqrs.AggregateType, ...) cqrs.Event
- func NewAggregateEventWithTime(typ cqrs.EventType, data cqrs.EventData, time time.Time, ...) cqrs.Event
- func NewWithTime(typ cqrs.EventType, data cqrs.EventData, time time.Time) cqrs.Event
- func Query(opts ...QueryOption) cqrs.EventQuery
- func Validate(events []cqrs.Event, originalVersion int) error
- type AggregateMismatchError
- type InconsistentVersionError
- type NotFoundError
- type OptimisticConcurrencyError
- type QueryOption
- type StoreError
- type UnregisteredError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MatchAggregate ¶
MatchAggregate ...
func MatchAggregateType ¶
func MatchAggregateType(typ cqrs.AggregateType) cqrs.EventMatcher
MatchAggregateType ...
func New ¶
func New(typ cqrs.EventType, data cqrs.EventData) cqrs.Event
New creates a new event with time set to time.Now().
func NewAggregateEvent ¶
func NewAggregateEvent(typ cqrs.EventType, data cqrs.EventData, aggregateType cqrs.AggregateType, aggregateID uuid.UUID, version int) cqrs.Event
NewAggregateEvent creates a new aggregate event with time set to time.Now().
func NewAggregateEventWithTime ¶
func NewAggregateEventWithTime(typ cqrs.EventType, data cqrs.EventData, time time.Time, aggregateType cqrs.AggregateType, aggregateID uuid.UUID, version int) cqrs.Event
NewAggregateEventWithTime creates a new aggregate event.
func NewWithTime ¶
NewWithTime creates a new event.
Types ¶
type AggregateMismatchError ¶
type AggregateMismatchError struct { ExpectedAggregateType cqrs.AggregateType ProvidedAggregateType cqrs.AggregateType ExpectedAggregateID uuid.UUID ProvidedAggregateID uuid.UUID }
AggregateMismatchError ...
func (AggregateMismatchError) Error ¶
func (err AggregateMismatchError) Error() string
type InconsistentVersionError ¶
type InconsistentVersionError struct { OriginalVersion int ExpectedVersion int ProvidedVersion int }
InconsistentVersionError ...
func (InconsistentVersionError) Error ¶
func (err InconsistentVersionError) Error() string
type NotFoundError ¶
NotFoundError ...
func (NotFoundError) Error ¶
func (err NotFoundError) Error() string
type OptimisticConcurrencyError ¶
type OptimisticConcurrencyError struct { AggregateType cqrs.AggregateType AggregateID uuid.UUID LatestVersion int ProvidedVersion int }
OptimisticConcurrencyError ...
func (OptimisticConcurrencyError) Error ¶
func (err OptimisticConcurrencyError) Error() string
type QueryOption ¶ added in v0.12.0
type QueryOption func(*query)
QueryOption ...
func QueryAggregateID ¶ added in v0.12.0
func QueryAggregateID(ids ...uuid.UUID) QueryOption
QueryAggregateID ...
func QueryAggregateType ¶ added in v0.12.0
func QueryAggregateType(types ...cqrs.AggregateType) QueryOption
QueryAggregateType ...
func QueryEventType ¶ added in v0.12.0
func QueryEventType(types ...cqrs.EventType) QueryOption
QueryEventType ...
func QueryVersionRanges ¶ added in v0.12.0
func QueryVersionRanges(ranges ...[2]int) QueryOption
QueryVersionRanges ...
func QueryVersions ¶ added in v0.12.0
func QueryVersions(versions ...int) QueryOption
QueryVersions ...
type UnregisteredError ¶
UnregisteredError is raised when an event type is not registered.
func (UnregisteredError) Error ¶
func (err UnregisteredError) Error() string
Click to show internal directories.
Click to hide internal directories.