webApi

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: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DassUrl = "http://192.168.40.43:8085"

var DassUrl = "http://127.0.0.1:8085"

View Source
var Points []*Point
View Source
var SyncPoints sync.Map

Functions

func AesDecrypt

func AesDecrypt(crypted, key []byte) ([]byte, error)

AES解密

func DecodePasswd

func DecodePasswd(pwd string) (string, error)

func GetAppInfo

func GetAppInfo() error

GetAppInfo 获取驱动信息

func GetBinName

func GetBinName() string

GetBinName 获取程序文件名

func GetConf

func GetConf() error

GetConf 获取驱动配置信息

func GetConfAndPoints

func GetConfAndPoints()

func GetPoint

func GetPoint()

func PKCS7UnPadding

func PKCS7UnPadding(origData []byte) []byte

func TodoCommand

func TodoCommand(res http.ResponseWriter, req *http.Request)

TodoCommand 提供web服务接口

Types

type AppInfoResponse

type AppInfoResponse struct {
	Code  int        `json:"code"`
	Count int        `json:"count"`
	Data  []AppInfoS `json:"data"`
	Msg   string     `json:"msg"`
}

type AppInfoS

type AppInfoS struct {
	Desc       string `json:"desc"`
	DriverType string `json:"driverType"`
	Host       string `json:"host"`
	Id         int    `json:"id"`
	Name       string `json:"name"`
	Port       int    `json:"port"`
	Status     string `json:"status"`
	Type       string `json:"type"`
}
var AppInfo AppInfoS

type Config

type Config struct {
	Key   string
	Value string
}
var Config_AppLogsLevel Config // 程序记录的日志级别 Info|Notice|Warning|Error|Alert|Emergency|Debug
var Config_ControlAddress Config // 下发控制命令的服务器, 控制到采集之间不能有隔离器
var Config_ControlEnable Config // 是否开启服务器控制功能, false: 不开启服务器控制 true: 开启服务器控制
var Config_ControlNamePrefix Config // 控制的节点名
var Config_ControlUserName Config // 下发控制命令的服务器用户名
var Config_ControlUserPassword Config // 下发控制命令的服务器密码
var Config_IsLink Config // 测点添加模式,true 为自动添加到实时库;false 为手动添加到实时库
var Config_LocalDataIpAddress Config // 本地Ip地址
var Config_LocalDataPortNumber Config // 本地端口号
var Config_MaximumMessageLength Config // 报文最大长度
var Config_ReceiveDataIpAddress Config // 接收数据IP地址
var Config_ReceiveDataPortNumber Config // 接收数据端口号
var Config_SourceInterval Config // 数据的读取间隔,循环读取一次的间隔时间,单位毫秒
var Config_WebListenAddress Config // 提供WEB服务的地址

type DriverConfResponse

type DriverConfResponse struct {
	Code  int `json:"code"`
	Count int `json:"count"`
	Data  []struct {
		Id       int    `json:"id"`
		Driver   string `json:"driver"`
		Model    string `json:"model"`
		ExScope  string `json:"exScope"`
		Name     string `json:"name"`
		Key      string `json:"key"`
		Value    string `json:"value"`
		Ed       string `json:"ed"`
		Flag     string `json:"flag"`
		TextType string `json:"textType"`
		TextData string `json:"textData"`
		Data1    string `json:"data1"`
		Data2    string `json:"data2"`
	} `json:"data"`
	Msg string `json:"msg"`
}
var DriverConf DriverConfResponse

type Point

type Point struct {
	ID      int     `json:"ID"`
	UID     int     `json:"UID"`
	PID     int     `json:"PID"`
	EVENT   int     `json:"EVENT"`
	PN      string  `json:"PN"`
	GN      string  `json:"GN"`
	SN      string  `json:"SN"`
	RT      int     `json:"RT"`
	AN      string  `json:"AN"`
	KR      string  `json:"KR"`
	SR      string  `json:"SR"`
	FB      int     `json:"FB"`
	FK      int     `json:"FK"`
	CP      string  `json:"CP"`
	AD      string  `json:"AD"`
	EU      string  `json:"EU"`
	TV      int     `json:"TV"`
	BV      int     `json:"BV"`
	DT      int     `json:"DT"`
	DB      float64 `json:"DB"`
	KZ      int     `json:"KZ"`
	EX      string  `json:"EX"`
	DS      int     `json:"DS"`
	PH      int     `json:"PH"`
	PL      int     `json:"PL"`
	ED      string  `json:"ED"`
	FQ      int     `json:"FQ"`
	FM      int     `json:"FM"`
	PT      int     `json:"PT"`
	KT      int     `json:"KT"`
	AP      int     `json:"AP"`
	LC      int     `json:"LC"`
	H4      int     `json:"H4"`
	H3      int     `json:"H3"`
	ZH      int     `json:"ZH"`
	HL      int     `json:"HL"`
	LL      int     `json:"LL"`
	ZL      int     `json:"ZL"`
	L3      int     `json:"L3"`
	L4      int     `json:"L4"`
	C1      int     `json:"C1"`
	C2      int     `json:"C2"`
	C3      int     `json:"C3"`
	C4      int     `json:"C4"`
	C5      int     `json:"C5"`
	C6      int     `json:"C6"`
	C7      int     `json:"C7"`
	C8      int     `json:"C8"`
	AV      int     `json:"AV"`
	AS      string  `json:"AS"`
	TM      int     `json:"TM"`
	FLAG    string  `json:"FLAG"`
	SYNC    string  `json:"SYNC"`
	REDATA1 string  `json:"REDATA1"`
	REDATA2 string  `json:"REDATA2"`
	TA      int     `json:"TA"`
	TF      int     `json:"TF"`
	MAXV    int     `json:"MAXV"`
	MINV    int     `json:"MINV"`
	MAXTIME int     `json:"MAXTIME"`
	MINTIME int     `json:"MINTIME"`
	AVGV    int     `json:"AVGV"`
	FLOW    int     `json:"FLOW"`
	PS      int     `json:"PS"`
	DD      string  `json:"DD"`
	KS      int     `json:"KS"`
	PD      int     `json:"PD"`
	AU      string  `json:"AU"`
	UD      int     `json:"UD"`
	HI      string  `json:"HI"`
	CT      int     `json:"CT"`
	TI      int     `json:"TI"`
	FS      int     `json:"FS"`
	DL      int     `json:"DL"`
	CD      int     `json:"CD"`
	IV      int     `json:"IV"`
	TP      int     `json:"TP"`
	ND      int     `json:"ND"`
	OT      int     `json:"OT"`
	TT      int     `json:"TT"`
	SG      string  `json:"SG"`
	AR      int     `json:"AR"`
	HW      int     `json:"HW"`
	ST      string  `json:"ST"`
	OF      int     `json:"OF"`
	BP      int     `json:"BP"`
	FL      int     `json:"FL"`
	RS      string  `json:"RS"`
	TN      string  `json:"TN"`
	Count   int     `json:"Count"`
}

type PointResponse

type PointResponse struct {
	Code  int      `json:"code"`
	Count int      `json:"count"`
	Data  []*Point `json:"data"`
	Msg   string   `json:"msg"`
}

Jump to

Keyboard shortcuts

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