Documentation
¶
Overview ¶
Package eml implements the Event Markup Language specification
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BoundedContext ¶
type BoundedContext struct { Name string `yaml:"Name"` Streams []Stream `yaml:"Streams"` Readmodels []Readmodel `yaml:"Readmodels"` }
A BoundedContext is a context in which a ubiquitous language applies.
type Command ¶
type Command struct { Command struct { Name string `yaml:"Name"` Parameters []Parameter `yaml:"Parameters"` Preconditions []string `yaml:"Preconditions"` Postconditions []string `yaml:"Postconditions"` } `yaml:"Command"` }
A Command in a bounded context
type Event ¶
type Event struct { Event struct { Name string `yaml:"Name"` Properties []Property `yaml:"Properties"` } `yaml:"Event"` }
An Event represents a fact that occurred as a result of a state change.
type Parameter ¶
type Parameter struct { Name string `yaml:"Name"` Type string `yaml:"Type"` Rules []string `yaml:"Rules"` }
A Parameter for a command.
func (*Parameter) MustExistInReadmodel ¶
MustExistInReadmodel gets a rule and it's parameters if it exists, otherwise nil.
func (*Parameter) RuleExists ¶
RuleExists verifies whether a command parameter validation rule exists.
type Property ¶
type Property struct { Name string `yaml:"Name"` Type string `yaml:"Type"` IsHashed bool `yaml:"IsHashed,omitempty"` }
A Property of an event.
type Readmodel ¶
type Readmodel struct { Readmodel struct { Name string `yaml:"Name"` Key string `yaml:"Key"` SubscribesTo []string `yaml:"SubscribesTo"` } `yaml:"Readmodel"` }
A Readmodel which subscribes to events
type Solution ¶
type Solution struct { EmlVersion string `yaml:"EmlVersion"` Name string `yaml:"Solution"` Contexts []BoundedContext `yaml:"Contexts"` Errors []ValidationError `yaml:"Errors"` // The presence of errors means that no API can be generated for the Solution. }
A Solution describes an event sourced system It will contain bounded contexts and meta information about what environment to deploy it to. It can also contain references to other bounded contexts from the 'PlayStore' (Context Store? Microservice Store?
type Stream ¶
type Stream struct { Name string `yaml:"Stream"` Commands []Command `yaml:"Commands"` Events []Event `yaml:"Events"` }
A Stream is a stream of events representing a transactional scope. In Domain Driven Design, this is known as an "aggregate". In comp sci, it can be represented as a state machine.