Documentation
¶
Overview ¶
Package fact contains structures that represents internal engine events. They are named facts to prevent ambiguity with Dogma application events.
Index ¶
- type AggregateInstanceCreated
- type AggregateInstanceDestroyed
- type AggregateInstanceLoaded
- type AggregateInstanceNotFound
- type Buffer
- type CommandExecutedByProcess
- type DispatchBegun
- type DispatchCompleted
- type DispatchCycleBegun
- type DispatchCycleCompleted
- type EventRecordedByAggregate
- type EventRecordedByIntegration
- type Fact
- type HandlingBegun
- type HandlingCompleted
- type HandlingSkipped
- type Logger
- type MessageLoggedByAggregate
- type MessageLoggedByIntegration
- type MessageLoggedByProcess
- type MessageLoggedByProjection
- type Observer
- type ObserverFunc
- type ObserverGroup
- type ProcessEventIgnored
- type ProcessInstanceBegun
- type ProcessInstanceEnded
- type ProcessInstanceLoaded
- type ProcessInstanceNotFound
- type ProcessTimeoutIgnored
- type ProjectionCompactionBegun
- type ProjectionCompactionCompleted
- type TickBegun
- type TickCompleted
- type TickCycleBegun
- type TickCycleCompleted
- type TimeoutScheduledByProcess
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregateInstanceCreated ¶
type AggregateInstanceCreated struct {
HandlerName string
Handler dogma.AggregateMessageHandler
InstanceID string
Root dogma.AggregateRoot
Envelope *envelope.Envelope
}
AggregateInstanceCreated indicates that an aggregate message handler created an aggregate instance while handling a command.
type AggregateInstanceDestroyed ¶
type AggregateInstanceDestroyed struct {
HandlerName string
Handler dogma.AggregateMessageHandler
InstanceID string
Root dogma.AggregateRoot
Envelope *envelope.Envelope
}
AggregateInstanceDestroyed indicates that an aggregate message handler destroyed an aggregate instance while handling a command.
type AggregateInstanceLoaded ¶
type AggregateInstanceLoaded struct {
HandlerName string
Handler dogma.AggregateMessageHandler
InstanceID string
Root dogma.AggregateRoot
Envelope *envelope.Envelope
}
AggregateInstanceLoaded indicates that an aggregate message handler has loaded an existing instance in order to handle a command.
type AggregateInstanceNotFound ¶
type AggregateInstanceNotFound struct {
HandlerName string
Handler dogma.AggregateMessageHandler
InstanceID string
Envelope *envelope.Envelope
}
AggregateInstanceNotFound indicates that an aggregate message handler was unable to load an existing instance while handling a command.
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
Buffer is an Observer that buffers facts in-memory.
It may be used by multiple goroutines simultaneously.
type CommandExecutedByProcess ¶
type CommandExecutedByProcess struct {
HandlerName string
Handler dogma.ProcessMessageHandler
InstanceID string
Root dogma.ProcessRoot
Envelope *envelope.Envelope
CommandEnvelope *envelope.Envelope
}
CommandExecutedByProcess indicates that a process executed a command while handling an event or timeout.
type DispatchBegun ¶
DispatchBegun indicates that Engine.Dispatch() has been called with a message that is able to be routed to at least one handler.
type DispatchCompleted ¶
DispatchCompleted indicates that a call Engine.Dispatch() has completed.
type DispatchCycleBegun ¶
type DispatchCycleBegun struct {
Envelope *envelope.Envelope
EngineTime time.Time
EnabledHandlers map[configkit.HandlerType]bool
}
DispatchCycleBegun indicates that Engine.Dispatch() has been called with a message that is able to be routed to at least one handler.
type DispatchCycleCompleted ¶
type DispatchCycleCompleted struct {
Envelope *envelope.Envelope
Error error
EnabledHandlers map[configkit.HandlerType]bool
}
DispatchCycleCompleted indicates that a call Engine.Dispatch() has completed.
type EventRecordedByAggregate ¶
type EventRecordedByAggregate struct {
HandlerName string
Handler dogma.AggregateMessageHandler
InstanceID string
Root dogma.AggregateRoot
Envelope *envelope.Envelope
EventEnvelope *envelope.Envelope
}
EventRecordedByAggregate indicates that an aggregate recorded an event while handling a command.
type EventRecordedByIntegration ¶
type EventRecordedByIntegration struct {
HandlerName string
Handler dogma.IntegrationMessageHandler
Envelope *envelope.Envelope
EventEnvelope *envelope.Envelope
}
EventRecordedByIntegration indicates that an integration recorded an event while handling a command.
type Fact ¶
type Fact interface {
}
Fact is an interface for internal engine events that occur while handling Dogma messages.
type HandlingBegun ¶
type HandlingBegun struct {
HandlerName string
HandlerType configkit.HandlerType
Envelope *envelope.Envelope
}
HandlingBegun indicates that a message is about to be handled by a specific handler.
type HandlingCompleted ¶
type HandlingCompleted struct {
HandlerName string
HandlerType configkit.HandlerType
Envelope *envelope.Envelope
Error error
}
HandlingCompleted indicates that a message has been handled by a specific handler, either successfully or unsuccessfully.
type HandlingSkipped ¶
type HandlingSkipped struct {
HandlerName string
HandlerType configkit.HandlerType
Envelope *envelope.Envelope
}
HandlingSkipped indicates that a message has been not been handled by a specific handler, because handlers of that type are disabled.
type Logger ¶
type Logger struct {
Log func(string)
}
Logger is an observer that logs human-readable messages to a log function.
type MessageLoggedByAggregate ¶
type MessageLoggedByAggregate struct {
HandlerName string
Handler dogma.AggregateMessageHandler
InstanceID string
Root dogma.AggregateRoot
Envelope *envelope.Envelope
LogFormat string
LogArguments []interface{}
}
MessageLoggedByAggregate indicates that an aggregate wrote a log message while handling a command.
type MessageLoggedByIntegration ¶
type MessageLoggedByIntegration struct {
HandlerName string
Handler dogma.IntegrationMessageHandler
Envelope *envelope.Envelope
LogFormat string
LogArguments []interface{}
}
MessageLoggedByIntegration indicates that an integration wrote a log message while handling a command.
type MessageLoggedByProcess ¶
type MessageLoggedByProcess struct {
HandlerName string
Handler dogma.ProcessMessageHandler
InstanceID string
Root dogma.ProcessRoot
Envelope *envelope.Envelope
LogFormat string
LogArguments []interface{}
}
MessageLoggedByProcess indicates that a process wrote a log message while handling an event or timeout.
type MessageLoggedByProjection ¶
type MessageLoggedByProjection struct {
HandlerName string
Handler dogma.ProjectionMessageHandler
Envelope *envelope.Envelope
LogFormat string
LogArguments []interface{}
}
MessageLoggedByProjection indicates that a projection wrote a log message while handling an event or compacting the projection.
Envelope is nil if the message was logged during compaction.
type Observer ¶
type Observer interface {
// Notify the observer of a fact.
Notify(Fact)
}
Observer is an interface that is notified when facts are recorded.
type ObserverFunc ¶
type ObserverFunc func(Fact)
ObserverFunc is an adaptor to allow the use of a regular function as an observer.
If f is a function with the appropriate signature, ObserverFunc(f) is an Observer that calls f.
var Ignore ObserverFunc = func(Fact) {}
Ignore is an observer that ignores fact notifications.
type ObserverGroup ¶
type ObserverGroup []Observer
ObserverGroup is a collection of observers that can be notified as a group.
func (ObserverGroup) Notify ¶
func (s ObserverGroup) Notify(f Fact)
Notify notifies all of the observers in the set of each of the given fact.
type ProcessEventIgnored ¶
type ProcessEventIgnored struct {
HandlerName string
Handler dogma.ProcessMessageHandler
Envelope *envelope.Envelope
}
ProcessEventIgnored indicates that a process message handler chose not to route an event to any instance.
type ProcessInstanceBegun ¶
type ProcessInstanceBegun struct {
HandlerName string
Handler dogma.ProcessMessageHandler
InstanceID string
Root dogma.ProcessRoot
Envelope *envelope.Envelope
}
ProcessInstanceBegun indicates that a process message handler began a process instance while handling an event.
type ProcessInstanceEnded ¶
type ProcessInstanceEnded struct {
HandlerName string
Handler dogma.ProcessMessageHandler
InstanceID string
Root dogma.ProcessRoot
Envelope *envelope.Envelope
}
ProcessInstanceEnded indicates that a process message handler destroyed a process instance while handling an event or timeout.
type ProcessInstanceLoaded ¶
type ProcessInstanceLoaded struct {
HandlerName string
Handler dogma.ProcessMessageHandler
InstanceID string
Root dogma.ProcessRoot
Envelope *envelope.Envelope
}
ProcessInstanceLoaded indicates that a process message handler has loaded an existing instance in order to handle an event or timeout.
type ProcessInstanceNotFound ¶
type ProcessInstanceNotFound struct {
HandlerName string
Handler dogma.ProcessMessageHandler
InstanceID string
Envelope *envelope.Envelope
}
ProcessInstanceNotFound indicates that a process message handler was unable to load an existing instance while handling an event or timeout.
type ProcessTimeoutIgnored ¶
type ProcessTimeoutIgnored struct {
HandlerName string
Handler dogma.ProcessMessageHandler
InstanceID string
Envelope *envelope.Envelope
}
ProcessTimeoutIgnored indicates that a process message handler ignored a timeout message because its instance no longer exists.
type ProjectionCompactionBegun ¶ added in v0.10.0
type ProjectionCompactionBegun struct {
HandlerName string
}
ProjectionCompactionBegun indicates that a projection is about to be compacted.
type ProjectionCompactionCompleted ¶ added in v0.10.0
ProjectionCompactionCompleted indicates that projection compaction has been performed, either successfully or unsuccessfully.
type TickBegun ¶
type TickBegun struct {
HandlerName string
HandlerType configkit.HandlerType
}
TickBegun indicates that a call to Controller.Tick() is being made.
type TickCompleted ¶
type TickCompleted struct {
HandlerName string
HandlerType configkit.HandlerType
Error error
}
TickCompleted indicates that a call to Controller.Tick() has completed.
type TickCycleBegun ¶
type TickCycleBegun struct {
EngineTime time.Time
EnabledHandlers map[configkit.HandlerType]bool
}
TickCycleBegun indicates that Engine.Tick() has been called.
type TickCycleCompleted ¶
type TickCycleCompleted struct {
Error error
EnabledHandlers map[configkit.HandlerType]bool
}
TickCycleCompleted indicates that a call Engine.Tick() has completed.
type TimeoutScheduledByProcess ¶
type TimeoutScheduledByProcess struct {
HandlerName string
Handler dogma.ProcessMessageHandler
InstanceID string
Root dogma.ProcessRoot
Envelope *envelope.Envelope
TimeoutEnvelope *envelope.Envelope
}
TimeoutScheduledByProcess indicates that a process scheduled a timeout while handling an event or timeout.