ddd

package
v0.0.0-...-3a9fddd Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregate

type Aggregate interface {
	Entity
	AddEvent(event Event)
	GetEvents() []Event
}

type AggregateBase

type AggregateBase struct {
	ID string
	// contains filtered or unexported fields
}

func (*AggregateBase) AddEvent

func (a *AggregateBase) AddEvent(event Event)

func (AggregateBase) GetEvents

func (a AggregateBase) GetEvents() []Event

func (AggregateBase) GetID

func (a AggregateBase) GetID() string

type Entity

type Entity interface {
	GetID() string
}

type EntityBase

type EntityBase struct {
	ID string
}

func (EntityBase) GetID

func (e EntityBase) GetID() string

type Event

type Event interface {
	EventName() string
}

type EventDispatcher

type EventDispatcher struct {
	// contains filtered or unexported fields
}

func NewEventDispatcher

func NewEventDispatcher() *EventDispatcher

func (*EventDispatcher) Publish

func (h *EventDispatcher) Publish(ctx context.Context, events ...Event) error

func (*EventDispatcher) Subscribe

func (h *EventDispatcher) Subscribe(event Event, handler EventHandler)

type EventHandler

type EventHandler func(ctx context.Context, event Event) error

type EventPublisher

type EventPublisher interface {
	Publish(ctx context.Context, events ...Event) error
}

type EventSubscriber

type EventSubscriber interface {
	Subscribe(event Event, handler EventHandler)
}

Jump to

Keyboard shortcuts

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