messaging

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 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 Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler default implementation of the messaging interface.

func NewDefaultImpl

func NewDefaultImpl(store store.MessageStore) (*Handler, error)

func (*Handler) GetClientInterface

func (d *Handler) GetClientInterface() gate.Gateway

func (*Handler) GetGroupInterface

func (d *Handler) GetGroupInterface() subscription.Interface

func (*Handler) Handle

func (d *Handler) Handle(cInfo *gate.Info, msg *messages.GlideMessage) error

func (*Handler) PutMessageHandler

func (d *Handler) PutMessageHandler(action messages.Action, i HandlerFunc)

func (*Handler) Run

func (d *Handler) Run() error

func (*Handler) SetGate

func (d *Handler) SetGate(g gate.Gateway)

func (*Handler) SetSubscription

func (d *Handler) SetSubscription(g subscription.Interface)

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

	// PutMessageHandler registers a handler for a message type/action.
	// If the handler is existing, it will be replaced.
	PutMessageHandler(action messages.Action, i HandlerFunc)
}

Interface for messaging.

type Messaging

type Messaging interface {
	Interface

	SetSubscription(g subscription.Interface)

	SetGate(g gate.Gateway)
}

type Server

type Server interface {
	Messaging

	SetSubscription(g subscription.Interface)

	Run() error
}

Server is the messaging server.

Jump to

Keyboard shortcuts

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