setup

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Aggregate added in v0.6.2

func Aggregate(typ cqrs.AggregateType, factory cqrs.AggregateFactory)

Aggregate registers a cqrs.AggregateType globally.

func Event added in v0.6.2

func Event(typ cqrs.EventType, proto cqrs.EventData)

Event registers a cqrs.EventType globally.

Types

type AggregateRepositoryFactory

type AggregateRepositoryFactory func(context.Context, cqrs.Container) (cqrs.AggregateRepository, error)

AggregateRepositoryFactory ...

type CommandBusFactory

type CommandBusFactory func(context.Context, cqrs.Container) (cqrs.CommandBus, error)

CommandBusFactory ...

type EventBusFactory

type EventBusFactory func(context.Context, cqrs.Container) (cqrs.EventBus, error)

EventBusFactory ...

type EventStoreFactory

type EventStoreFactory func(context.Context, cqrs.Container) (cqrs.EventStore, error)

EventStoreFactory ...

type Option

type Option func(*Setup)

Option is a setup option.

func Logger added in v0.11.0

func Logger(logger *log.Logger) Option

Logger adds a logger to the setup.

func WithAggregateConfig added in v0.11.0

func WithAggregateConfig(cfg cqrs.AggregateConfig) Option

WithAggregateConfig adds a cqrs.AggregateConfig to the setup.

func WithAggregateRepositoryFactory

func WithAggregateRepositoryFactory(f AggregateRepositoryFactory) Option

WithAggregateRepositoryFactory adds an EventStoreFactory to the setup.

func WithCommandBusFactory

func WithCommandBusFactory(f CommandBusFactory) Option

WithCommandBusFactory adds an EventStoreFactory to the setup.

func WithEventBusFactory

func WithEventBusFactory(f EventBusFactory) Option

WithEventBusFactory adds an EventStoreFactory to the setup.

func WithEventConfig added in v0.11.0

func WithEventConfig(cfg cqrs.EventConfig) Option

WithEventConfig adds a cqrs.EventConfig to the setup.

func WithEventStoreFactory

func WithEventStoreFactory(f EventStoreFactory) Option

WithEventStoreFactory adds an EventStoreFactory to the setup.

func WithLogger

func WithLogger(logger *log.Logger) Option

WithLogger adds a logger to the setup.

func WithSnapshotConfig added in v0.11.1

func WithSnapshotConfig(cfg aggregate.SnapshotConfig) Option

WithSnapshotConfig adds a snapshot config to the setup.

func WithSnapshotRepositoryFactory

func WithSnapshotRepositoryFactory(f SnapshotRepositoryFactory) Option

WithSnapshotRepositoryFactory adds an EventStoreFactory to the setup.

type Setup

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

Setup is the setup helper.

func New

func New(opts ...Option) *Setup

New initiates a setup.

func (*Setup) Command added in v0.11.0

func (s *Setup) Command(h cqrs.CommandHandler, types ...cqrs.CommandType) *Setup

Command configures the cqrs.CommandHandler for multiple cqrs.CommandTypes.

func (*Setup) Container added in v0.11.0

func (s *Setup) Container(ctx context.Context) (cqrs.Container, error)

Container initializes the components and returns a cqrs.Container.

type SnapshotRepositoryFactory

type SnapshotRepositoryFactory func(context.Context, cqrs.Container) (cqrs.SnapshotRepository, error)

SnapshotRepositoryFactory ...

Jump to

Keyboard shortcuts

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