Documentation
¶
Index ¶
- type Aggregator
- type Alarm
- type AlarmContent
- type Any
- type Calculator
- type Command
- type Component
- type DailyChecker
- type DataPoint
- type DataType
- func (dt *DataType) Decode(buf []byte, le bool) (float64, error)
- func (dt *DataType) Encode(val float64, le bool) []byte
- func (dt *DataType) MarshalJSON() ([]byte, error)
- func (dt *DataType) Parse(tp string) error
- func (dt *DataType) Size() int
- func (dt *DataType) String() string
- func (dt *DataType) UnmarshalJSON(buf []byte) error
- type DelayChecker
- type Device
- type DeviceAlarm
- type DeviceContent
- type DeviceEx
- type DeviceHistory
- type Directive
- type Element
- type ElementHistory
- type Entity
- type Event
- type HMI
- type Hash
- type HeartBeatPacket
- type HmiEvent
- type HmiValue
- type Invoke
- type Job
- type Link
- type LinkEx
- type Password
- type Pipe
- type PipeEx
- type Point
- type Poller
- type Project
- type ProjectAlarm
- type ProjectContent
- type ProjectDevice
- type ProjectEx
- type ProjectHistory
- type Protocol
- type RegisterPacket
- type RepeatChecker
- type Retry
- type SerialOptions
- type Strategy
- type Template
- type TemplateElement
- type TemplateHistory
- type TimeRange
- type Tunnel
- type TunnelDevice
- type TunnelEx
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aggregator ¶
type Aggregator struct { Targets []string `json:"targets"` Type string `json:"type"` As string `json:"as"` Expression string `json:"expression"` }
Aggregator 聚合器
type Alarm ¶
type Alarm struct { Disabled bool `json:"disabled"` //条件 Condition string `json:"condition"` //重复日 DailyChecker //延迟报警 DelayChecker //重复报警 RepeatChecker //产生告警 AlarmContent }
Alarm 数据校验
type AlarmContent ¶
type AlarmContent struct { Code string `json:"code"` Level int `json:"level"` Message string `json:"message"` }
AlarmContent 告警内容
type Calculator ¶
type Calculator struct { Expression string `json:"expression"` As string `json:"as"` // contains filtered or unexported fields }
Calculator 计算器
type Component ¶ added in v1.1.0
type Component struct { Id string `json:"id" xorm:"pk"` Icon string `json:"icon"` //url svg png jpg ... Name string `json:"name"` Drawer string `json:"drawer"` // "rect" | "circle" | "line" | "poly" //分组(默认 扩展) Group string `json:"group"` //基础配置 Color bool `json:"color"` //填充色 Stroke bool `json:"stroke"` //线条 Rotation bool `json:"rotation"` //旋转 Position bool `json:"position"` //位置 //扩展配置项 Properties []Hash `json:"properties"` //事件 Events []HmiEvent `json:"events"` //监听 Values []HmiValue `json:"values"` //初始化 Create string `json:"create"` //写入配置 Setup string `json:"setup"` //更新数据 Update string `json:"update"` //产生变量 data(){return {a:1, b2}} Data string `json:"data"` Updated time.Time `json:"updated" xorm:"updated"` Created time.Time `json:"created" xorm:"created"` Deleted time.Time `json:"-" xorm:"deleted"` }
type DailyChecker ¶
type DailyChecker struct { Times []TimeRange `json:"times"` Weekdays []time.Weekday `json:"weekdays"` }
DailyChecker 每日检查
type DataType ¶
type DataType int
DataType 数据类型
func (*DataType) UnmarshalJSON ¶
UnmarshalJSON 解析
type DelayChecker ¶
type DelayChecker struct { Delay int64 `json:"delay"` // contains filtered or unexported fields }
DelayChecker 延时检查
type Device ¶
type Device struct { Id int64 `json:"id"` LinkId int64 `json:"link_id" xorm:"index"` ElementId string `json:"element_id"` Name string `json:"name"` Station int `json:"station"` DeviceContent `xorm:"extends"` Disabled bool `json:"disabled"` Updated time.Time `json:"updated" xorm:"updated"` Created time.Time `json:"created" xorm:"created"` Deleted time.Time `json:"-" xorm:"deleted"` }
Device 设备
type DeviceAlarm ¶
type DeviceAlarm struct { Id int64 `json:"id"` DeviceId int64 `json:"device_id" xorm:"index"` AlarmContent `xorm:"extends"` Created time.Time `json:"created" xorm:"created"` }
DeviceAlarm 设备告警
type DeviceContent ¶
type DeviceEx ¶
type DeviceHistory ¶
type Directive ¶
type Directive struct { Point string `json:"point"` Value float64 `json:"value"` Delay int64 `json:"delay"` //使用表达式 Expression string `json:"expression,omitempty"` }
Directive 指令
type Element ¶
type Element struct { Id string `json:"id" xorm:"pk"` Name string `json:"name"` Manufacturer string `json:"manufacturer"` //厂家 Version string `json:"version"` //SEMVER DeviceContent `xorm:"extends"` Updated time.Time `json:"updated" xorm:"updated"` Created time.Time `json:"created" xorm:"created"` Deleted time.Time `json:"-" xorm:"deleted"` }
Element 元件
type ElementHistory ¶
type HMI ¶ added in v1.1.0
type HMI struct { Id string `json:"id" xorm:"pk"` Name string `json:"name"` Width int `json:"width"` Height int `json:"height"` Snap string `json:"snap"` Entities []Entity `json:"entities"` Updated time.Time `json:"updated" xorm:"updated"` Created time.Time `json:"created" xorm:"created"` Deleted time.Time `json:"-" xorm:"deleted"` }
type HeartBeatPacket ¶
type HeartBeatPacket struct { Enable bool `json:"enable"` Timeout int64 `json:"timeout"` Regex string `json:"regex,omitempty"` Hex string `json:"hex,omitempty"` Text string `json:"text,omitempty"` // contains filtered or unexported fields }
HeartBeatPacket 心跳包
type Invoke ¶
type Invoke struct { Targets []string `json:"targets"` Command string `json:"command"` Arguments []string `json:"arguments"` }
Invoke 执行
type Job ¶
type Job struct { Disabled bool `json:"disabled"` Type string `json:"type"` //clock, crontab Clock int `json:"clock,omitempty"` Weekdays []time.Weekday `json:"weekdays"` Crontab string `json:"crontab,omitempty"` Invokes []Invoke `json:"invokes"` }
Job 任务
type Link ¶
type Link struct { Id int64 `json:"id"` TunnelId int64 `json:"tunnel_id" xorm:"index"` SN string `json:"sn" xorm:"index 'sn'"` Name string `json:"name"` Remote string `json:"remote"` Disabled bool `json:"disabled"` Last time.Time `json:"last"` Updated time.Time `json:"updated" xorm:"updated"` Created time.Time `json:"created" xorm:"created"` Deleted time.Time `json:"-" xorm:"deleted"` }
Link 链接模型
type LinkEx ¶
type PipeEx ¶
type Point ¶
type Point struct { Name string `json:"name"` Label string `json:"label"` Unit string `json:"unit"` Type DataType `json:"type"` Precision int `json:"precision"` Address string `json:"address"` Default float64 `json:"default"` LittleEndian bool `json:"little_endian"` }
Point 数据点
type Poller ¶
type Poller struct { Disabled bool `json:"disabled"` Type string `json:"type"` //interval, clock, crontab Interval int `json:"interval,omitempty"` Clock int `json:"clock,omitempty"` Crontab string `json:"crontab,omitempty"` Address string `json:"address"` Length int `json:"length"` }
Poller 采集器
type Project ¶
type Project struct { Id int64 `json:"id"` Name string `json:"name"` Devices []*ProjectDevice `json:"devices"` TemplateId string `json:"template_id,omitempty"` ProjectContent `xorm:"extends"` Disabled bool `json:"disabled"` Updated time.Time `json:"updated" xorm:"updated"` Created time.Time `json:"created" xorm:"created"` Deleted time.Time `json:"-" xorm:"deleted"` }
Project 项目
type ProjectAlarm ¶
type ProjectAlarm struct { Id int64 `json:"id"` ProjectId int64 `json:"project_id" xorm:"index"` AlarmContent `xorm:"extends"` Created time.Time `json:"created" xorm:"created"` }
ProjectAlarm 项目告警
type ProjectContent ¶
type ProjectContent struct { HMI string `json:"hmi" xorm:"'hmi'"` Aggregators []*Aggregator `json:"aggregators"` Jobs []*Job `json:"jobs"` Alarms []*Alarm `json:"alarms"` Strategies []*Strategy `json:"strategies"` }
type ProjectDevice ¶
ProjectDevice 项目的设备
type ProjectEx ¶
type ProjectHistory ¶
type RegisterPacket ¶
type RegisterPacket struct { Enable bool `json:"enable"` Regex string `json:"regex,omitempty"` Length int `json:"length,omitempty"` // contains filtered or unexported fields }
RegisterPacket 注册包
type RepeatChecker ¶
type RepeatChecker struct { ResetTimeout int64 `json:"reset_timeout"` ResetTotal int `json:"reset_total,omitempty"` // contains filtered or unexported fields }
RepeatChecker 重复发生器
type SerialOptions ¶
type SerialOptions struct { //PortName string `json:"port_name"` // /dev/tty.usb.. COM1 BaudRate uint `json:"baud_rate"` //9600 ... 115200 ... DataBits uint `json:"data_bits"` //5 6 7 8 StopBits uint `json:"stop_bits"` //1 2 ParityMode uint `json:"parity_mode"` // 0:NONE 1:ODD 2:EVEN RS485 bool `json:"rs485"` }
SerialOptions 串口参数
type Strategy ¶
type Strategy struct { Disabled bool `json:"disabled"` //名称 Name string `json:"name"` //条件 Condition string `json:"condition"` //重复日 DailyChecker //延迟报警 DelayChecker //重复报警 RepeatChecker //执行命令 Invokes []*Invoke `json:"invokes,omitempty"` }
Strategy 响应,待改名
type Template ¶
type Template struct { Id string `json:"id" xorm:"pk"` Name string `json:"name"` Version string `json:"version"` //SEMVER Elements []*TemplateElement `json:"elements"` ProjectContent `xorm:"extends"` Updated time.Time `json:"updated" xorm:"updated"` Created time.Time `json:"created" xorm:"created"` Deleted time.Time `json:"-" xorm:"deleted"` }
type TemplateElement ¶
type TemplateHistory ¶
type Tunnel ¶
type Tunnel struct { Id int64 `json:"id"` Name string `json:"name"` Type string `json:"type"` //serial tcp-client tcp-server udp-client udp-server Addr string `json:"addr"` Retry Retry `json:"retry" xorm:"JSON"` //重试 Register RegisterPacket `json:"register" xorm:"JSON"` Heartbeat HeartBeatPacket `json:"heartbeat" xorm:"JSON"` Serial SerialOptions `json:"serial" xorm:"JSON"` Protocol Protocol `json:"protocol" xorm:"JSON"` Devices []TunnelDevice `json:"devices"` //默认设备 Disabled bool `json:"disabled"` Updated time.Time `json:"updated" xorm:"updated"` Created time.Time `json:"created" xorm:"created"` Deleted time.Time `json:"-" xorm:"deleted"` }
Tunnel 通道模型
type TunnelDevice ¶
type User ¶
type User struct { Id int64 `json:"id"` Username string `json:"username" xorm:"unique"` Nickname string `json:"nickname,omitempty"` Email string `json:"email,omitempty"` Disabled bool `json:"disabled"` Updated time.Time `json:"updated" xorm:"updated"` Created time.Time `json:"created" xorm:"created"` Deleted time.Time `json:"-" xorm:"deleted"` }
User 用户
Click to show internal directories.
Click to hide internal directories.