memory

package
v4.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandBus

type CommandBus struct {
	Handlers CommandMapper
}

func NewCommandBus

func NewCommandBus(mapper CommandMapper) (*CommandBus, error)

func (*CommandBus) Dispatch

func (b *CommandBus) Dispatch(command *commands.Command) error

func (*CommandBus) Register

func (b *CommandBus) Register(key commands.Key, handler commands.Handler) error

type CommandMapper

type CommandMapper = map[commands.Key]commands.Handler

type EventBus

type EventBus struct {
	Consumers EventMapper
}

func NewEventBus

func NewEventBus(mapper EventMapper) (*EventBus, error)

func (*EventBus) Publish

func (b *EventBus) Publish(event *events.Event) error

func (*EventBus) Subscribe

func (b *EventBus) Subscribe(key events.Key, consumer events.Consumer) error

type EventMapper

type EventMapper = map[events.Key][]events.Consumer

type QueryBus

type QueryBus struct {
	Handlers QueryMapper
}

func NewQueryBus

func NewQueryBus(mapper QueryMapper) (*QueryBus, error)

func (*QueryBus) Ask

func (b *QueryBus) Ask(query *queries.Query) (*queries.Response, error)

func (*QueryBus) Register

func (b *QueryBus) Register(key queries.Key, handler queries.Handler) error

type QueryMapper

type QueryMapper = map[queries.Key]queries.Handler

Jump to

Keyboard shortcuts

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