mqtt

package
v0.0.0-...-7797f25 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const CLIENT_ID = "spaceDevicesGo"

Variables

This section is empty.

Functions

func EnableMqttDebugLogging

func EnableMqttDebugLogging()

func GenerateRandomBytes

func GenerateRandomBytes(n int) []byte

GenerateRandomBytes returns securely generated random bytes. It will fail with a fatal log if the system's secure random number generator fails to function correctly

func GenerateRandomString

func GenerateRandomString(s int) string

GenerateRandomString returns a URL-safe, base64 encoded securely generated random string. It will fail with a fatal log if the system's secure random number generator fails to function correctly

func NewWatchDog

func NewWatchDog(timeout time.Duration) *watchDog

NewWatchDog creates a new watch dog timeout - after this amount of time without a ping, the program will be killed and returns 3

Types

type DeviceData

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

func NewDeviceData

func NewDeviceData(locations []conf.Location, mqttHandler *MqttHandler, masterDb db.MasterDb, userDb db.UserDb) *DeviceData

func (*DeviceData) GetByIp

func (d *DeviceData) GetByIp(ip string) (structs.WifiSession, bool)

finds the session entry for the given ip v4 or v6 address

func (*DeviceData) GetOneEntry

func (d *DeviceData) GetOneEntry() []structs.WifiSession

func (*DeviceData) ListenAndUpdatePeopleData

func (d *DeviceData) ListenAndUpdatePeopleData()

type MqttHandler

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

func NewMqttHandler

func NewMqttHandler(conf conf.MqttConf, clientOnly bool) *MqttHandler

func (*MqttHandler) GetNewDataChannel

func (h *MqttHandler) GetNewDataChannel() chan []byte

func (*MqttHandler) SendPeopleAndDevices

func (h *MqttHandler) SendPeopleAndDevices(data structs.PeopleAndDevices)

Jump to

Keyboard shortcuts

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