Documentation
¶
Index ¶
- type ActionHandler
- type ActionWithReplyHandler
- type HandlerFunc
- type Interface
- type MessageHandler
- type MessageInterfaceImpl
- func (d *MessageInterfaceImpl) AddHandler(i MessageHandler)
- func (d *MessageInterfaceImpl) GetClientInterface() gate.Gateway
- func (d *MessageInterfaceImpl) GetGroupInterface() subscription.Interface
- func (d *MessageInterfaceImpl) Handle(cInfo *gate.Info, msg *messages.GlideMessage) error
- func (d *MessageInterfaceImpl) OnHandleMessageError(cInfo *gate.Info, msg *messages.GlideMessage, err error)
- func (d *MessageInterfaceImpl) SetGate(g gate.Gateway)
- func (d *MessageInterfaceImpl) SetSubscription(g subscription.Interface)
- type Messaging
- type ReplyHandlerFunc
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionHandler ¶ added in v1.2.1
type ActionHandler struct {
// contains filtered or unexported fields
}
ActionHandler is a handler for a specific message action.
func NewActionHandler ¶ added in v1.2.1
func NewActionHandler(action messages.Action, fn HandlerFunc) *ActionHandler
func (*ActionHandler) Handle ¶ added in v1.2.1
func (a *ActionHandler) Handle(h *MessageInterfaceImpl, cliInfo *gate.Info, message *messages.GlideMessage) bool
type ActionWithReplyHandler ¶ added in v1.2.1
type ActionWithReplyHandler struct {
// contains filtered or unexported fields
}
ActionWithReplyHandler is a handler for a specific message action, this handler will return a reply message.
func NewActionWithReplyHandler ¶ added in v1.2.1
func NewActionWithReplyHandler(action messages.Action, fn ReplyHandlerFunc) *ActionWithReplyHandler
func (*ActionWithReplyHandler) Handle ¶ added in v1.2.1
func (rh *ActionWithReplyHandler) Handle(h *MessageInterfaceImpl, cInfo *gate.Info, msg *messages.GlideMessage) bool
type HandlerFunc ¶
type HandlerFunc func(cliInfo *gate.Info, message *messages.GlideMessage) error
type Interface ¶
type Interface interface {
// Handle handles message from gate, the entry point for the messaging.
Handle(clientInfo *gate.Info, msg *messages.GlideMessage) error
AddHandler(i MessageHandler)
}
Interface for messaging.
type MessageHandler ¶ added in v1.2.1
type MessageHandler interface {
// Handle handles the message, returns true if the message is handled,
// otherwise the message is delegated to next handler.
Handle(h *MessageInterfaceImpl, cliInfo *gate.Info, message *messages.GlideMessage) bool
}
MessageHandler is the interface for message handler
type MessageInterfaceImpl ¶ added in v1.2.1
type MessageInterfaceImpl struct {
// contains filtered or unexported fields
}
MessageInterfaceImpl default implementation of the messaging interface.
func NewDefaultImpl ¶
func NewDefaultImpl(store store.MessageStore) (*MessageInterfaceImpl, error)
func (*MessageInterfaceImpl) AddHandler ¶ added in v1.2.1
func (d *MessageInterfaceImpl) AddHandler(i MessageHandler)
func (*MessageInterfaceImpl) GetClientInterface ¶ added in v1.2.1
func (d *MessageInterfaceImpl) GetClientInterface() gate.Gateway
func (*MessageInterfaceImpl) GetGroupInterface ¶ added in v1.2.1
func (d *MessageInterfaceImpl) GetGroupInterface() subscription.Interface
func (*MessageInterfaceImpl) Handle ¶ added in v1.2.1
func (d *MessageInterfaceImpl) Handle(cInfo *gate.Info, msg *messages.GlideMessage) error
func (*MessageInterfaceImpl) OnHandleMessageError ¶ added in v1.2.1
func (d *MessageInterfaceImpl) OnHandleMessageError(cInfo *gate.Info, msg *messages.GlideMessage, err error)
func (*MessageInterfaceImpl) SetGate ¶ added in v1.2.1
func (d *MessageInterfaceImpl) SetGate(g gate.Gateway)
func (*MessageInterfaceImpl) SetSubscription ¶ added in v1.2.1
func (d *MessageInterfaceImpl) SetSubscription(g subscription.Interface)
type Messaging ¶
type Messaging interface {
Interface
SetSubscription(g subscription.Interface)
SetGate(g gate.Gateway)
}
type ReplyHandlerFunc ¶ added in v1.2.1
type ReplyHandlerFunc func(cliInfo *gate.Info, message *messages.GlideMessage) (*messages.GlideMessage, error)
Click to show internal directories.
Click to hide internal directories.