edge

package
v0.0.0-...-ae4999c Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Active

func Active(conf *Conf) error

Active 激活设备

func ActiveDevice

func ActiveDevice(device model.Device, config *config.Config) error

func Add

func Add(url string)

Add 增加一个edge URL

func GetBaseInfo

func GetBaseInfo(uid string) (map[string]interface{}, error)

GetBaseInfo 用于获取设备基本信息

func GetCHValue

func GetCHValue(device model.Device, chTagName string) (map[string]interface{}, error)

func GetRealTimeData

func GetRealTimeData(device model.Device) (interface{}, error)

func GetRealtimeData

func GetRealtimeData(uid string) (interface{}, error)

GetRealtimeData 获取指定设备的实时数据

func GetStatus

func GetStatus(device model.Device) (map[string]interface{}, error)

func GetValue

func GetValue(uid string, tag string) (map[string]interface{}, error)

GetValue 获取设备指定点位的值

func Invoke

func Invoke(url, cmd string, request interface{}) (*Result, error)

func Remove

func Remove(uid string)

Remove 移除一个设备

func Reset

func Reset(uid string)

Reset 通知设备刷新配置

func ResetConfig

func ResetConfig(device model.Device)

func Restart

func Restart(url string)

Restart 重启指定的edge

func SetCHValue

func SetCHValue(device model.Device, chTagName string, v interface{}) error

func SetValue

func SetValue(uid string, tag string, val interface{}) error

SetValue 设置设备指定点位的值

Types

type Balance

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

func (*Balance) DeltaTotal

func (b *Balance) DeltaTotal(delta int)

func (*Balance) Get

func (b *Balance) Get(uid string, key string) *balanceCacheEntry

func (*Balance) Remove

func (b *Balance) Remove(uid string)

func (*Balance) Set

func (b *Balance) Set(uid string, key string, value interface{})

type EdgesMap

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

func (*EdgesMap) AddDevice

func (e *EdgesMap) AddDevice(uid string) *Balance

func (*EdgesMap) GetBalanceByDeviceUID

func (e *EdgesMap) GetBalanceByDeviceUID(uid string) *Balance

Jump to

Keyboard shortcuts

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