fact

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package fact contains structures that represents internal engine events. They are named facts to prevent ambiguity with Dogma application events.

Index

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.

func (*Buffer) Facts

func (b *Buffer) Facts() []Fact

Facts returns the facts that have been buffered so far.

func (*Buffer) Notify

func (b *Buffer) Notify(f Fact)

Notify appends f to b.Facts.

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

type DispatchBegun struct {
	Envelope *envelope.Envelope
}

DispatchBegun indicates that Engine.Dispatch() has been called with a message that is able to be routed to at least one handler.

type DispatchCompleted

type DispatchCompleted struct {
	Envelope *envelope.Envelope
	Error    error
}

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.

func NewLogger

func NewLogger(log func(string)) *Logger

NewLogger returns a new observer that logs human-readable descriptions of facts to the given log function.

func (*Logger) Notify

func (l *Logger) Notify(f Fact)

Notify the observer of a fact.generates the log message for f.

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.

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.

func (ObserverFunc) Notify

func (fn ObserverFunc) Notify(f Fact)

Notify calls fn(f).

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 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.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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