distributed

package
v4.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2020 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPayload         = errors.New("invalid payload")
	ErrSessionMetadatasExists = errors.New("session metadatas already exists")
)
View Source
var (
	ErrSessionMetadatasNotFound = errors.New("session metadatas not found")
)

Functions

This section is empty.

Types

type Channel

type Channel interface {
	Events() chan []byte
	Broadcast(b []byte)
	BroadcastFullState(b []byte)
}

type SessionMetadatasState

type SessionMetadatasState interface {
	Create(id string, clientID string, connectedAt int64, lwt *packet.Publish, mountpoint string) error
	Get(id string) (api.SessionMetadatas, error)
	ByClientID(clientID string) (api.SessionMetadatas, error)
	ByPeer(peer uint64) []api.SessionMetadatas
	All() []api.SessionMetadatas
	Delete(id string) error
	DeletePeer(peer uint64) error
}

type State

type State interface {
	Subscriptions() SubscriptionsState
	SessionMetadatas() SessionMetadatasState
	Topics() TopicsState
	Distributor() memberlist.Delegate
}

func NewState

func NewState(peer uint64, bcast *memberlist.TransmitLimitedQueue, recorder audit.Recorder) State

type SubscriptionsState

type SubscriptionsState interface {
	Create(sessionID string, pattern []byte, qos int32) error
	CreateFrom(sessionID string, peer uint64, pattern []byte, qos int32) error
	All() []api.Subscription
	ByPattern(pattern []byte) []api.Subscription
	ByPeer(peer uint64) []api.Subscription
	Delete(sessionID string, pattern []byte) error
	DeletePeer(peer uint64)
	DeleteSession(sessionID string)
}

type TopicsState

type TopicsState interface {
	Set(message *packet.Publish) error
	Delete(topic []byte) error
	Get(pattern []byte) ([]api.RetainedMessage, error)
}

Jump to

Keyboard shortcuts

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