messaging

package
v1.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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

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)

type Server

type Server interface {
	Messaging

	Run() error
}

Server is the messaging server.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL