Documentation ¶
Index ¶
- Constants
- func NewEvent(name string, payload EventPayload, options ...EventOption) event
- func SetEvents(events ...Event) registry.BuildOption
- func SetID(id string) registry.BuildOption
- func SetName(name string) registry.BuildOption
- type Aggregate
- type AggregateEvent
- type AggregateNamer
- type Entity
- type EntityNamer
- type Event
- type EventDispatcher
- type EventHandler
- type EventHandlerFunc
- type EventOption
- type EventPayload
- type EventPublisher
- type EventSubscriber
- type Eventer
- type EventsSetter
- type IDSetter
- type IDer
- type Metadata
- type NameSetter
Constants ¶
View Source
const ( AggregateNameKey = "aggregate-name" AggregateIDKey = "aggregate-id" AggregateVersionKey = "aggregate-version" )
Variables ¶
This section is empty.
Functions ¶
func NewEvent ¶
func NewEvent(name string, payload EventPayload, options ...EventOption) event
func SetEvents ¶
func SetEvents(events ...Event) registry.BuildOption
func SetID ¶
func SetID(id string) registry.BuildOption
func SetName ¶
func SetName(name string) registry.BuildOption
Types ¶
type Aggregate ¶
type Aggregate struct { Entity // contains filtered or unexported fields }
func NewAggregate ¶
func (*Aggregate) AddEvent ¶
func (a *Aggregate) AddEvent(name string, payload EventPayload, options ...EventOption)
func (Aggregate) AggregateName ¶
func (*Aggregate) ClearEvents ¶
func (a *Aggregate) ClearEvents()
func (Aggregate) Events ¶
func (a Aggregate) Events() []AggregateEvent
type AggregateEvent ¶
type AggregateNamer ¶
type AggregateNamer interface {
AggregateName() string
}
type Entity ¶
type Entity struct {
// contains filtered or unexported fields
}
func (Entity) EntityName ¶
type EntityNamer ¶
type EntityNamer interface {
EntityName() string
}
type EventDispatcher ¶
type EventDispatcher[T Event] struct { // contains filtered or unexported fields }
func NewEventDispatcher ¶
func NewEventDispatcher[T Event]() *EventDispatcher[T]
func (*EventDispatcher[T]) Subscribe ¶
func (h *EventDispatcher[T]) Subscribe(name string, handler EventHandler[T])
type EventHandler ¶
type EventHandlerFunc ¶
func (EventHandlerFunc[T]) HandleEvent ¶
type EventOption ¶
type EventOption interface {
// contains filtered or unexported methods
}
type EventPayload ¶
type EventPayload interface{}
type EventPublisher ¶
type EventSubscriber ¶
type EventSubscriber[T Event] interface { Subscribe(name string, handler EventHandler[T]) }
type Eventer ¶
type Eventer interface { AddEvent(string, EventPayload, ...EventOption) Events() []AggregateEvent ClearEvents() }
type EventsSetter ¶
type EventsSetter interface {
// contains filtered or unexported methods
}
type NameSetter ¶
type NameSetter interface {
// contains filtered or unexported methods
}
Click to show internal directories.
Click to hide internal directories.