handler

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ServiceNotFound = errors.New("service not found")

Functions

func CheckEvent

func CheckEvent(connector *platform_connector_lib.Connector, token security.JwtToken, deviceUri string, serviceUri string) (err error)

func CheckHub

func CheckHub(connector *platform_connector_lib.Connector, token security.JwtToken, hubId string, deviceUri string) (err error)

func ParseTopic

func ParseTopic(topic string) (prefix string, deviceUri string, serviceUri string, err error)

Types

type Handler

type Handler interface {
	Subscribe(clientId string, user string, topic string) (result Result, err error)
	Publish(clientId string, user string, topic string, payload []byte, qos int, size float64) (result Result, err error)
}

type Result

type Result int
const (
	Unhandled Result = iota
	Accepted
	Rejected
	Error
)

func HandleTopicSubscribe

func HandleTopicSubscribe(clientId string, username string, topic string, handlers []Handler) (Result, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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