Documentation
¶
Overview ¶
Package handler provides utilities for working with Dogma message handlers.
Index ¶
- Variables
- type EmptyInstanceIDError
- type EventNotRecordedError
- type NilRootError
- type Type
- func (t Type) Consumes() []message.Role
- func (t Type) Is(types ...Type) bool
- func (t Type) IsConsumerOf(r message.Role) bool
- func (t Type) IsProducerOf(r message.Role) bool
- func (t Type) MustBe(types ...Type)
- func (t Type) MustNotBe(types ...Type)
- func (t Type) MustValidate()
- func (t Type) Produces() []message.Role
- func (t Type) ShortString() string
- func (t Type) String() string
Constants ¶
This section is empty.
Variables ¶
var Types = []Type{ AggregateType, ProcessType, IntegrationType, ProjectionType, }
Types is a slice of the valid handler types.
Functions ¶
This section is empty.
Types ¶
type EmptyInstanceIDError ¶
EmptyInstanceIDError indicates that an aggregate or process message handler has attempted to route a message to an instance with an empty ID.
func (EmptyInstanceIDError) Error ¶
func (e EmptyInstanceIDError) Error() string
type EventNotRecordedError ¶
EventNotRecordedError indicates that an aggregate instance was created or destroyed without recording an event.
func (EventNotRecordedError) Error ¶
func (e EventNotRecordedError) Error() string
type NilRootError ¶
NilRootError indicates that an aggregate or process message handler has returned a nil "root" value from its New() method.
func (NilRootError) Error ¶
func (e NilRootError) Error() string
type Type ¶
type Type string
Type is an enumeration of the types of handlers.
const ( // AggregateType is the handler type for dogma.AggregateMessageHandler. AggregateType Type = "aggregate" // ProcessType is the handler type for dogma.ProcessMessageHandler. ProcessType Type = "process" // IntegrationType is the handler type for dogma.IntegrationMessageHandler. IntegrationType Type = "integration" // ProjectionType is the handler type for dogma.ProjectionMessageHandler. ProjectionType Type = "projection" )
func ConsumersOf ¶
ConsumersOf returns the handler types that can consume messages with the given role.
func ProducersOf ¶
ProducersOf returns the handler types that can produces messages with the given role.
func (Type) Consumes ¶
Consumes returns the roles of messages that can be consumed by handlers of this type.
func (Type) IsConsumerOf ¶
IsConsumerOf returns true if handlers of type t can consume messages with the given role.
func (Type) IsProducerOf ¶
IsProducerOf returns true if handlers of type t can produce messages with the given role.
func (Type) MustValidate ¶
func (t Type) MustValidate()
MustValidate panics if r is not a valid message role.
func (Type) Produces ¶
Produces returns the roles of messages that can be produced by handlers of this type.
func (Type) ShortString ¶
ShortString returns a short (3-character) representation of the handler type.