adaptors

package
v0.0.0-...-12080e3 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package adaptors includes various server connector and data processors

Index

Constants

This section is empty.

Variables

View Source
var MQ = make(chan common.MSG, 10)

MQ is the message queue which Adaptors push message to

View Source
var Running = make(map[string]Adaptor)

Running adaptors

Functions

func Create

func Create(opts common.KVM) error

Create adaptor instance

func HandleMessage

func HandleMessage(msg common.MSG)

HandleMessage handles messages from device

func StopAll

func StopAll()

StopAll stops all running adaptors

Types

type Adaptor

type Adaptor interface {
	HandleMessage(msg common.MSG)
	Stop()
}

Adaptor interface

type BYAdaptor

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

BYAdaptor defines the local adaptor

func (*BYAdaptor) HandleMessage

func (a *BYAdaptor) HandleMessage(msg common.MSG)

HandleMessage will be called when a device message is received

func (*BYAdaptor) Init

func (a *BYAdaptor) Init(opts common.KVM) error

Init the adaptors data

func (*BYAdaptor) Stop

func (a *BYAdaptor) Stop()

Stop the adaptor

type TBAdaptor

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

TBAdaptor defines the Thingsboard adaptor

func (*TBAdaptor) GET

func (a *TBAdaptor) GET(path string, params req.Param) (*req.Resp, error)

GET request

func (*TBAdaptor) HandleMessage

func (a *TBAdaptor) HandleMessage(msg common.MSG)

HandleMessage will be called when a device message is received

func (*TBAdaptor) Init

func (a *TBAdaptor) Init(opts common.KVM) error

Init the adaptors data

func (*TBAdaptor) POST

func (a *TBAdaptor) POST(path string, params req.Param) (*req.Resp, error)

POST request

func (*TBAdaptor) Stop

func (a *TBAdaptor) Stop()

Stop the adaptor

Jump to

Keyboard shortcuts

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