event

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Config

func Config() cqrs.EventConfig

Config returns a new event config.

func MatchAggregate

func MatchAggregate(typ cqrs.AggregateType, id uuid.UUID) cqrs.EventMatcher

MatchAggregate ...

func MatchAggregateID

func MatchAggregateID(id uuid.UUID) cqrs.EventMatcher

MatchAggregateID ...

func MatchAggregateType

func MatchAggregateType(typ cqrs.AggregateType) cqrs.EventMatcher

MatchAggregateType ...

func MatchMaxVersion

func MatchMaxVersion(maxVersion int) cqrs.EventMatcher

MatchMaxVersion ...

func MatchMinVersion

func MatchMinVersion(minVersion int) cqrs.EventMatcher

MatchMinVersion ...

func MatchType

func MatchType(typ cqrs.EventType) cqrs.EventMatcher

MatchType ...

func MatchVersion

func MatchVersion(version int) cqrs.EventMatcher

MatchVersion ...

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

func NewWithTime(typ cqrs.EventType, data cqrs.EventData, time time.Time) cqrs.Event

NewWithTime creates a new event.

func Query added in v0.12.0

func Query(opts ...QueryOption) cqrs.EventQuery

Query ...

func Validate

func Validate(events []cqrs.Event, originalVersion int) error

Validate validates events.

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

type NotFoundError struct {
	AggregateType cqrs.AggregateType
	AggregateID   uuid.UUID
	Version       int
}

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 StoreError

type StoreError struct {
	Err       error
	StoreName string
}

StoreError ...

func (StoreError) Error

func (err StoreError) Error() string

func (StoreError) Unwrap

func (err StoreError) Unwrap() error

Unwrap ...

type UnregisteredError

type UnregisteredError struct {
	EventType cqrs.EventType
}

UnregisteredError is raised when an event type is not registered.

func (UnregisteredError) Error

func (err UnregisteredError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL