aggregate

package
v0.0.0-...-eecab09 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseAggregate

type BaseAggregate struct {
	// The aggregate ID
	ID string
	// The aggregate type
	Type string
	// The aggregate version
	Version int
	// The aggregate events
	Events []event.DomainEvent
}

func (*BaseAggregate) ApplyEventHelper

func (b *BaseAggregate) ApplyEventHelper(aggregate Handler, event *event.DomainEvent, commit bool) error

func (*BaseAggregate) ClearUnCommitedEvents

func (b *BaseAggregate) ClearUnCommitedEvents()

func (*BaseAggregate) GetID

func (b *BaseAggregate) GetID() string

func (*BaseAggregate) GetTypeName

func (b *BaseAggregate) GetTypeName(source interface{}) (reflect.Type, string)

func (*BaseAggregate) GetVersion

func (b *BaseAggregate) GetVersion() int

func (*BaseAggregate) IncrementVersion

func (b *BaseAggregate) IncrementVersion()

func (*BaseAggregate) UnCommitedEvents

func (b *BaseAggregate) UnCommitedEvents() []event.DomainEvent

type Handler

type Handler interface {
	LoadFromHistory(events []event.DomainEvent) error
	ApplyEvent(event *event.DomainEvent) error
	ApplyEventHelper(aggregate Handler, event *event.DomainEvent, commit bool) error
	// HandleCommand(command interface{}) error
	UnCommitedEvents() []event.DomainEvent
	ClearUnCommitedEvents()
	IncrementVersion()
	GetID() string
	GetTypeName(source interface{}) (reflect.Type, string)
	GetVersion() int
}

Jump to

Keyboard shortcuts

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