Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandBus ¶
type CommandBus interface { // Register assign a command to a command handle for future executions. Register(interface{}, interface{}) error // Handlers returns all registered handlers. Handlers() handlers // Use adds middleware to the chain. Use(...MiddlewareFunc) // Execute send a given Command to its assigned command handler. Execute(context.Context, interface{}) error }
CommandBus is the definition of how command should be handled
func New ¶
func New() CommandBus
type HandlerFunc ¶ added in v0.2.2
HandlerFunc defines a function to execute the command handler. This function type is only used by `MiddlewareFunc`.
type MiddlewareFunc ¶
type MiddlewareFunc func(h HandlerFunc) HandlerFunc
MiddlewareFunc defines a function to process middleware. it receives the next Handler must return another handler
Click to show internal directories.
Click to hide internal directories.