Documentation
¶
Index ¶
- Variables
- func DispatchCommand[C Command, R any](ctx context.Context, cmd C) (R, error)
- func DispatchQuery[Q Query, R any](ctx context.Context, q Q) (R, error)
- func Publish[E Event](ctx context.Context, e E) error
- func RegisterCommand[C Command, R any](h CommandHandler[C, R])
- func RegisterEvent[E Event](h EventHandler[E])
- func RegisterQuery[Q Query, R any](h QueryHandler[Q, R])
- type Command
- type CommandHandler
- type Event
- type EventHandler
- type Query
- type QueryHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCommandHandlerNotFound = errors.New("command handler not found") ErrQueryHandlerNotFound = errors.New("query handler not found") )
Functions ¶
func DispatchCommand ¶ added in v0.2.0
func RegisterCommand ¶
func RegisterCommand[C Command, R any](h CommandHandler[C, R])
func RegisterEvent ¶
func RegisterEvent[E Event](h EventHandler[E])
func RegisterQuery ¶
func RegisterQuery[Q Query, R any](h QueryHandler[Q, R])
Types ¶
type CommandHandler ¶
Click to show internal directories.
Click to hide internal directories.