Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregateRoot ¶
type AggregateRoot interface { }
type DomainEvent ¶
type DomainEvent[T any, ID any] interface { // SameEventAs return true if the given domain event and this event are regarded as being the same event. SameEventAs(other T) bool ID() ID Kind() string When() time.Time }
DomainEvent is something that is unique, but does not have a lifecycle. The identity may be explicit, for example the sequence number of a payment, or it could be derived from various aspects of the event such as where, when and what has happened.
type Entity ¶
type Entity[T any, ID any] interface { // SameIdentityAs return true if the identities are the same, regardless of other attributes. SameIdentityAs(other T) bool // Identity return the identity of this entity. Identity() ID }
Entity as explained in the DDD book. Entities compare by identity, not by attributes.
type EventDescriptor ¶ added in v1.2.1
func EventDescriptorFromEvent ¶ added in v1.2.1
func EventDescriptorFromEvent[T any, ID any](e DomainEvent[T, ID]) *EventDescriptor
func NewEventDescriptor ¶ added in v1.2.1
func NewEventDescriptor(body string, occurredAt time.Time, kind string) *EventDescriptor
type ValueObject ¶
type ValueObject[T any] interface { // SameValueAs return ture if the given value object's and this value object's attributes are the same. SameValueAs(other T) bool // Copy return A safe, deep copy of this value object. Copy() T }
ValueObject as described in the DDD book. Value objects compare by the values of their attributes, they don't have an identity.
Click to show internal directories.
Click to hide internal directories.