Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MessageHandler ¶
type MessageHandler struct {
// contains filtered or unexported fields
}
A MessageHandler is responsible for routing messages of a set of types to their associated handler functions.
func NewMessageHandler ¶
func NewMessageHandler() *MessageHandler
NewMessageHandler initializes and returns a pointer to a new MessageHandler.
func (*MessageHandler) AddHandler ¶
func (h *MessageHandler) AddHandler(msgType string, handlerFunc MessageHandlerFunc)
AddHandler is used to register a MessageHandlerFunc for a given message type. This currently on supports a single handler for each message type. Subsequent calls to AddHandler will replace the current handler for a given message type. Last write wins.
Click to show internal directories.
Click to hide internal directories.