listener

package
v0.0.0-...-e53b992 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Url      string
	Filename string
	Username string
	Password string
}

type Listener

type Listener struct {
	Config    *Configuration
	TopicName string
	TLSConfig *tls.Config
	// contains filtered or unexported fields
}

func NewListener

func NewListener(config *Configuration) *Listener

func (*Listener) ClientOptions

func (l *Listener) ClientOptions() *mqtt.ClientOptions

func (*Listener) MessageHandler

func (l *Listener) MessageHandler() mqtt.MessageHandler

func (*Listener) PublishExampleMessages

func (l *Listener) PublishExampleMessages(number int)

Publish sample messages to the topic at qos 1 and wait for the receipt from the server after sending each message

func (*Listener) Start

func (l *Listener) Start() error

func (*Listener) Stop

func (l *Listener) Stop()

Unsubscribe from topic

type TransitionMessage

type TransitionMessage struct {
	Wtst  int64   // Time of waypoint creation
	Lat   float32 // Latitude
	Long  float32 // Longitude
	Tst   int64   // Timestamp of transition
	Acc   uint32  // Accuracy of Lat/Long
	Tid   string  // Tracker ID
	Event string  // Enter or Leave
	Desc  string  // Description
}

func NewTransitionMessage

func NewTransitionMessage(payload []byte) (*TransitionMessage, error)

func (*TransitionMessage) Timestamp

func (tm *TransitionMessage) Timestamp() time.Time

Jump to

Keyboard shortcuts

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