cqrs

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2020 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(store rangedb.Store, options ...Option) *cqrs

New constructs an event sourced CQRS application

Types

type Aggregate

type Aggregate interface {
	Load(<-chan *rangedb.Record)
	Handle(Command) []rangedb.Event
	CommandTypes() []string
}

type Command

type Command interface {
	rangedb.AggregateMessage
	CommandType() string
}

type CommandDispatcher

type CommandDispatcher interface {
	Dispatch(Command) []rangedb.Event
}

type Option

type Option func(*cqrs)

Option defines functional option parameters for App.

func WithAggregates

func WithAggregates(aggregates ...Aggregate) Option

WithAggregates is a functional option to inject an aggregate command handler.

func WithLogger

func WithLogger(logger *log.Logger) Option

WithLogger is a functional option to inject a Logger.

Jump to

Keyboard shortcuts

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