openplant

package
v0.0.0-...-864f672 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const Exp = 30

Variables

View Source
var MsgChan chan map[int][2]interface{}

MsgChan 报文chan,将解析到的报文写入

View Source
var WriteChan chan []*Realtime

WriteChan 实时值chan

Functions

func KeepTokenAlive

func KeepTokenAlive()

KeepTokenAlive 更新token

func LoginOpenplant

func LoginOpenplant(user, password string) (token string, err error)

LoginOpenplant 登陆webapi

func PushMsgChan

func PushMsgChan(msg map[int][2]interface{})

PushMsgChan 将消息推送至chan

func WirteRealtime

func WirteRealtime()

WirteRealtime 写openplant接口

func WriteArchive

func WriteArchive(point []*Realtime, token string) (err error)

WriteArchive 写历史数据

func WriteRealtime

func WriteRealtime(point []*Realtime, token string) (err error)

WriteRealtime 写实时数据

Types

type LoginResponse

type LoginResponse struct {
	Flag    int    `json:"flag"`
	Message string `json:"message"`
	Data    string `json:"data"`
}

type Realtime

type Realtime struct {
	AV interface{} `json:"AV"`
	DS int         `json:"DS"`
	GN string      `json:"GN"`
	ID int         `json:"ID"`
	TM int64       `json:"TM"`
}

type Token

type Token struct {
	Data    string
	Timeout int64
}
var TokenData Token

Jump to

Keyboard shortcuts

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