event

package
v0.0.0-...-ee0c78d Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseEvent

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

func NewBaseEvent

func NewBaseEvent(aggregateID string) BaseEvent

func (BaseEvent) AggregateID

func (b BaseEvent) AggregateID() string

func (BaseEvent) ID

func (b BaseEvent) ID() string

func (BaseEvent) OccurredOn

func (b BaseEvent) OccurredOn() time.Time

type Bus

type Bus interface {
	// Publish is the method used to publish new events.
	Publish(context.Context, []Event) error
	// Subscribe is the method used to subscribe new event handlers.
	Subscribe(Type, Handler)
}

Bus defines the expected behaviour from an event bus.

type Event

type Event interface {
	ID() string
	AggregateID() string
	OccurredOn() time.Time
	Type() Type
}

Event represents a domain command.

type Handler

type Handler interface {
	Handle(context.Context, Event) error
}

Handler defines the expected behaviour from an event handler.

type Type

type Type string

Type represents a domain event type.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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