topic

package
v0.0.0-...-fc90c2c Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMemManager

func NewMemManager() *memManager

NewMemManager returns an new instance of the memManager, which is implements the Manager interface. memManager is a hidden struct that stores the topic subscriptions and retained messages in memory. The content is not persistend so when the server goes, everything will be gone. Use with care.

Types

type Manager

type Manager interface {
	Subscribe(sub Subscription) (byte, error)
	Unsubscribe(sub Subscription) error
	Subscribers(topic []byte, qos byte, subs *[]interface{}, qoss *[]byte) error
	Retain(msg *packets.PublishPacket) error
	Retained(topic []byte, msgs *[]*packets.PublishPacket) error
	Close() error
}

Manager

type Subscription

type Subscription struct {
	ClientID string
	Topic    string
	QoS      byte
	Shared   bool
	Group    string
}

func NewSubscription

func NewSubscription(clientID string, topic string, qos byte, shared bool, group string) Subscription

type Topic

type Topic struct {
	Subs map[string]Subscription
	Mu   sync.RWMutex
}

Jump to

Keyboard shortcuts

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