devicetwin

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//EventActionMap map for event to action
	EventActionMap map[string]map[string]string
	//ActionModuleMap map for action to module
	ActionModuleMap map[string]string
)

Functions

func SyncDeviceFromSqlite

func SyncDeviceFromSqlite(context *dtcontext.DTContext, deviceID string) error

SyncDeviceFromSqlite sync device from sqlite

func SyncSqlite

func SyncSqlite(context *dtcontext.DTContext) error

SyncSqlite sync sqlite

Types

type DTController

type DTController struct {
	HeartBeatToModule map[string]chan interface{}
	DTContexts        *dtcontext.DTContext
	DTModules         map[string]dtmodule.DTModule
	Stop              chan bool
}

DTController controller for devicetwin

func InitDTController

func InitDTController(context *context.Context) (*DTController, error)

InitDTController init dtcontroller

func (*DTController) RegisterDTModule

func (dtc *DTController) RegisterDTModule(name string)

RegisterDTModule register dtmodule

func (*DTController) Start

func (dtc *DTController) Start() error

Start devicetwin controller

type DeviceTwin

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

DeviceTwin the module

func (*DeviceTwin) Cleanup

func (dt *DeviceTwin) Cleanup()

Cleanup clean resource after quit

func (*DeviceTwin) Group

func (dt *DeviceTwin) Group() string

Group get group of the module

func (*DeviceTwin) Name

func (dt *DeviceTwin) Name() string

Name get name of the module

func (*DeviceTwin) Start

func (dt *DeviceTwin) Start(c *context.Context)

Start run the module

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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