Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command interface {
CommandID() string
}
Command defines command pattern interface.
type CompositeHandler ¶
type CompositeHandler struct {
// contains filtered or unexported fields
}
CompositeHandler a command bus.
func NewCompositeHandler ¶
func NewCompositeHandler() *CompositeHandler
NewCompositeHandler creates a new instance of CompositeHandler.
func (*CompositeHandler) Handle ¶
func (ch *CompositeHandler) Handle(c Command) error
Handle dispatches the given Command to its appropriate Handler and handles it.
func (*CompositeHandler) RegisterHandler ¶
func (ch *CompositeHandler) RegisterHandler(commandID string, h Handler) *CompositeHandler
RegisterHandler registers a Handler for the given CommandID.