Documentation ¶
Index ¶
- type AggregateDataModel
- type AggregateRoot
- func (a *AggregateRoot) AddDomainEvent(event IDomainEvent) error
- func (a *AggregateRoot) AddDomainEvents(event IDomainEvent)
- func (a *AggregateRoot) GetUncommittedEvents() []IDomainEvent
- func (a *AggregateRoot) HasUncommittedEvents() bool
- func (a *AggregateRoot) MarkUncommittedEventAsCommitted()
- func (a *AggregateRoot) OriginalVersion() int64
- func (a *AggregateRoot) String() string
- type DomainEvent
- type Entity
- type EntityDataModel
- type EventEnvelope
- type IAggregateRoot
- type IDomainEvent
- type IEntity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregateDataModel ¶
type AggregateDataModel struct { *EntityDataModel OriginalVersion int64 `json:"originalVersion" bson:"originalVersion,omitempty"` }
type AggregateRoot ¶
type AggregateRoot struct { *Entity // contains filtered or unexported fields }
AggregateRoot base aggregate contains all main necessary fields
func NewAggregateRoot ¶
func NewAggregateRoot(aggregateType string) *AggregateRoot
func NewAggregateRootWithId ¶
func NewAggregateRootWithId(id uuid.UUID, aggregateType string) *AggregateRoot
func (*AggregateRoot) AddDomainEvent ¶
func (a *AggregateRoot) AddDomainEvent(event IDomainEvent) error
func (*AggregateRoot) AddDomainEvents ¶
func (a *AggregateRoot) AddDomainEvents(event IDomainEvent)
func (*AggregateRoot) GetUncommittedEvents ¶
func (a *AggregateRoot) GetUncommittedEvents() []IDomainEvent
GetUncommittedEvents get AggregateRoot uncommitted domain_events events
func (*AggregateRoot) HasUncommittedEvents ¶
func (a *AggregateRoot) HasUncommittedEvents() bool
HasUncommittedEvents returns true if AggregateRoot has uncommitted domain_events events
func (*AggregateRoot) MarkUncommittedEventAsCommitted ¶
func (a *AggregateRoot) MarkUncommittedEventAsCommitted()
MarkUncommittedEventAsCommitted clear AggregateRoot uncommitted domain_events events
func (*AggregateRoot) OriginalVersion ¶
func (a *AggregateRoot) OriginalVersion() int64
func (*AggregateRoot) String ¶
func (a *AggregateRoot) String() string
type DomainEvent ¶
type DomainEvent struct { *events.Event AggregateId uuid.UUID `json:"aggregate_id"` AggregateSequenceNumber int64 `json:"aggregate_sequence_number"` }
func NewDomainEvent ¶
func NewDomainEvent(eventType string) *DomainEvent
func (*DomainEvent) GetAggregateId ¶
func (d *DomainEvent) GetAggregateId() uuid.UUID
func (*DomainEvent) GetAggregateSequenceNumber ¶
func (d *DomainEvent) GetAggregateSequenceNumber() int64
func (*DomainEvent) WithAggregate ¶
func (d *DomainEvent) WithAggregate( aggregateId uuid.UUID, aggregateSequenceNumber int64, ) *DomainEvent
type Entity ¶
type Entity struct {
// contains filtered or unexported fields
}
func NewEntityWithId ¶
NewEntityWithId creates a new Entity with an id
func (*Entity) EntityType ¶
func (*Entity) SetEntityType ¶
func (*Entity) SetUpdatedAt ¶
type EntityDataModel ¶
type EventEnvelope ¶
type IAggregateRoot ¶
type IAggregateRoot interface { IEntity // OriginalVersion Gets the original version is the aggregate version we got from the store. This is used to ensure optimistic concurrency, // to check if there were no changes made to the aggregate state between load and save for the current operation. OriginalVersion() int64 // AddDomainEvents adds a new domain_events event to the aggregate's uncommitted events. AddDomainEvents(event IDomainEvent) error // MarkUncommittedEventAsCommitted Mark all changes (events) as committed, clears uncommitted changes and updates the current version of the aggregate. MarkUncommittedEventAsCommitted() // HasUncommittedEvents Does the aggregate have change that have not been committed to storage HasUncommittedEvents() bool // GetUncommittedEvents Gets a list of uncommitted events for this aggregate. GetUncommittedEvents() []IDomainEvent // String Returns a string representation of the aggregate. String() string }
type IDomainEvent ¶
Click to show internal directories.
Click to hide internal directories.