Documentation ¶
Index ¶
Constants ¶
View Source
const ( CompanyAggregate = "company" CompanyCreatedEvent = "peof.organization.CompanyCreated" CompanyNameChangedEvent = "peof.organization.CompanyNameChanged" )
View Source
const ( EventTypeKey = "eventType" EventVersionKey = "eventVersion" EventTimestampKey = "eventTimestamp" AggregateIdKey = "aggregateId" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aggregate ¶
type Aggregate interface {
Events() []Event
}
aggregates accumulate domain events generated by business logic execution
following the execution of business logic these events should be stored as an event log and dispatched as messages to other interested parties
type Company ¶
func (*Company) ChangeName ¶
type CompanyCreated ¶
type CompanyCreated struct { EventRoot `bson:",inline"` CompanyName string `bson:"companyName" json:"companyName"` }
func (CompanyCreated) FromMap ¶
func (e CompanyCreated) FromMap(mapEvent map[string]interface{}) Event
func (CompanyCreated) Root ¶
func (e CompanyCreated) Root() EventRoot
type CompanyNameChanged ¶
type CompanyNameChanged struct { EventRoot `bson:",inline"` CompanyName string `bson:"companyName" json:"companyName"` }
func (CompanyNameChanged) FromMap ¶
func (e CompanyNameChanged) FromMap(mapEvent map[string]interface{}) Event
func (CompanyNameChanged) Root ¶
func (e CompanyNameChanged) Root() EventRoot
type EventPublisher ¶
domain event dispatcher
type EventRoot ¶
type EventRoot struct { EventType string `bson:"eventType" json:"eventType"` Version float32 `bson:"eventVersrsionion" json:"eventVe"` Timestamp int64 `bson:"eventTimestamp" json:"eventTimestamp"` AggregateId string `bson:"aggregateId" json:"aggregateId"` }
domain events have these root properties
Click to show internal directories.
Click to hide internal directories.