property

package
v0.0.0-...-42499df Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Normal          = iota //正常0
	High                   //高报1
	Low                    //低报2
	Internal               //探测器内部错误3
	Communication          //通讯错误4
	Shield                 //主机屏蔽探测器5
	SlaveHitch             //探测器故障6
	MainHitch              //主电故障
	PrepareHitch           //备电故障
	MainFailback           //主电故障恢复
	PrepareFailback        //备电故障恢复

	DATA           = "data"
	ALARM          = "alarm"
	HITCH          = "hitch"
	ONLINE         = "online"  //上线
	OFFLINE        = "offline" //下线
	ONLINE_INT     = 1         //上线
	OFFLINE_INT    = 0         //下线
	HostController = 1         //主机
	Detector       = 2         //探测器
)
View Source
const MAX_PARTITIONS = 10

Change max partitions as you need.

Variables

This section is empty.

Functions

func Publish

func Publish(topic string, data interface{})

func Start

func Start()

Types

type ApiLine

type ApiLine struct {
	DeviceId string `json:"deviceId"`
	Status   int    `json:"status"`
}

type Data

type Data struct {
	Iccid string `json:"iccid"`
	Sl    int    `json:"sl"`
	Da    string `json:"da"`
	Le    int    `json:"le"`
	Si    int    `json:"si"`
}

func (*Data) Execute

func (d *Data) Execute()

type DeviceMsg

type DeviceMsg struct {
	Ts           time.Time `json:"ts"`
	DataType     string    `json:"dataType"`
	Level        int       `json:"level"`
	DeviceId     string    `json:"deviceId"`
	GroupId      int       `json:"groupId"`
	Status       string    `json:"status"`
	DeviceType   int       `json:"deviceType"`
	Name         string    `json:"name" `
	SlaveId      int       `json:"slaveId"`
	SlaveName    string    `json:"slaveName"`
	Address      string    `json:"address"`
	Data         string    `json:"data"`
	Unit         string    `json:"unit"`
	PropertyName string    `json:"propertyName"`
	Signal       int       `json:"signal"`
	OrgId        int       `json:"orgId"`
}

func (DeviceMsg) TaosCols

func (r DeviceMsg) TaosCols() []string

Use specific column names as you need

func (DeviceMsg) TaosDatabase

func (r DeviceMsg) TaosDatabase() string

If this is setted, sql will use db.table for tablename

func (DeviceMsg) TaosSTable

func (r DeviceMsg) TaosSTable() string

Auto create table using stable and tags

func (DeviceMsg) TaosTable

func (r DeviceMsg) TaosTable() string

Dynamic device id as table name

func (DeviceMsg) TaosTags

func (r DeviceMsg) TaosTags() []interface{}

tags must be setted with TaosSTable

func (DeviceMsg) TaosValues

func (r DeviceMsg) TaosValues() []interface{}

Values

type Event

type Event struct {
	Iccid string `json:"iccid"`
	Sl    int    `json:"sl"`
	Da    string `json:"da"`
	Le    int    `json:"le"`
}

func (*Event) Execute

func (d *Event) Execute()

type Interface

type Interface interface {
	// contains filtered or unexported methods
}

type Line

type Line struct {
	Iccid  string `json:"iccid"`
	Status string `json:"status"`
}

func (*Line) Execute

func (l *Line) Execute()

type Metadata

type Metadata struct {
	Iccid string           `json:"iccid"`
	Co    int              `json:"co"`
	List  []*SlaveMetadata `json:"list"`
}

func (*Metadata) Execute

func (m *Metadata) Execute()

type SlaveMetadata

type SlaveMetadata struct {
	Sl int `json:"sl"`
	Pr int `json:"pr"`
}

Jump to

Keyboard shortcuts

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