Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrHandlerAlreadySet = errors.New("handler is already set")
ErrHandlerAlreadySet is when a handler is already registered for a command.
View Source
var ErrHandlerNotFound = errors.New("no handlers for command")
ErrHandlerNotFound is when no handler can be found.
Functions ¶
This section is empty.
Types ¶
type CommandHandler ¶
type CommandHandler struct {
// contains filtered or unexported fields
}
CommandHandler is a command handler that handles commands by routing to the registered CommandHandlers.
func NewCommandHandler ¶
func NewCommandHandler() *CommandHandler
NewCommandHandler creates a CommandHandler.
func (*CommandHandler) HandleCommand ¶
HandleCommand handles a command with a handler capable of handling it.
func (*CommandHandler) SetHandler ¶
func (h *CommandHandler) SetHandler(handler eh.CommandHandler, cmdType eh.CommandType) error
SetHandler adds a handler for a specific command.
Click to show internal directories.
Click to hide internal directories.