topicaliases

package
v0.0.0-...-b1094b1 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: EPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TAHandler

type TAHandler struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewTAHandler

func NewTAHandler(max uint16) *TAHandler

func (*TAHandler) GetAlias

func (t *TAHandler) GetAlias(topic string) uint16

GetAlias will return the alias for a given topic string

func (*TAHandler) GetTopic

func (t *TAHandler) GetTopic(a uint16) string

GetTopic will return the topic for a given alias number

func (*TAHandler) PublishHook

func (t *TAHandler) PublishHook(p *paho.Publish)

PublishHook is designed to be given to an MQTT client and will be executed before a publish is sent allowing it to modify the Properties of the packet. In this case it allows the Topic Alias Handler to automatically replace topic names with alias numbers

func (*TAHandler) ResetAlias

func (t *TAHandler) ResetAlias(topic string, a uint16)

ResetAlias reassigns a given alias number for a new topic

func (*TAHandler) SetAlias

func (t *TAHandler) SetAlias(topic string) uint16

SetAlias will request an alias number for a given string

Jump to

Keyboard shortcuts

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