Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrHandlerAlreadySet is when SetHandler fails because a handler is already registered for a // command type. ErrHandlerAlreadySet = errors.New("handler is already set") // ErrHandlerNotFound is when HandleCommand or HandleCommandEx fails because no handler is // registered for the given command type. ErrHandlerNotFound = errors.New("no handlers for command") )
Functions ¶
This section is empty.
Types ¶
type CommandHandler ¶
type CommandHandler struct {
// contains filtered or unexported fields
}
CommandHandler in the domain-eventing package is an eventing.CommandHandler that handles commands by routing them to the other eventing.CommandHandlers that are registered in it.
func NewCommandHandler ¶
func NewCommandHandler() *CommandHandler
NewCommandHandler creates a CommandHandler with no eventing.CommandHandlers registered. Call SetHandler() to add handlers to it.
func (*CommandHandler) HandleCommand ¶
HandleCommand handles a command with a handler capable of handling it.
func (*CommandHandler) HandleCommandEx ¶
func (h *CommandHandler) HandleCommandEx(ctx context.Context, cmd eventing.Command) ([]common.Event, error)
HandleCommandEx handles a command with a handler capable of handling it.
func (*CommandHandler) SetHandler ¶
func (h *CommandHandler) SetHandler(handler eventing.CommandHandler, cmdType common.CommandType) error
SetHandler adds/registers a handler for a specific command type. Only one handler can be set for a command type.
Click to show internal directories.
Click to hide internal directories.