Documentation ¶
Index ¶
- Variables
- type Aggregator
- type Alarm
- type App
- type AppEntry
- type AppHistory
- type Broker
- type BrokerHistory
- type DataType
- func (dt *DataType) Decode(buf []byte, le bool, precision int) (val interface{}, err error)
- func (dt *DataType) Default() interface{}
- func (dt *DataType) Encode(value interface{}, le bool, precision int) []byte
- func (dt *DataType) MarshalJSON() ([]byte, error)
- func (dt *DataType) Normalize(val interface{}) interface{}
- 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 Device
- type DeviceEvent
- type DeviceHistory
- type Gateway
- type History
- type License
- type Me
- type ModAggregator
- type ModArgument
- type ModEvent
- type ModFunction
- type ModParameter
- type ModProperty
- type ModValidator
- type Parameters
- type Password
- type Plugin
- type Privilege
- type Product
- type Role
- type User
- type UserHistory
- type Validator
- type Variables
Constants ¶
This section is empty.
Variables ¶
View Source
var PRIVILEGES = map[string]string{
"ALL": "全部权限",
"BROKER": "总线查看",
"BROKER-EDIT": "总线管理",
"PRODUCT": "产品查看",
"PRODUCT-EDIT": "产品管理",
"DEVICE": "设备查看",
"DEVICE-EDIT": "设备管理",
"ALARM": "报警查看",
"ALARM-EDIT": "报警管理",
"USER": "用户查看",
"USER-EDIT": "用户管理",
"PLUGIN": "插件查看",
"PLUGIN-EDIT": "插件管理",
"SETTING": "系统设置",
}
Functions ¶
This section is empty.
Types ¶
type Aggregator ¶ added in v3.2.5
type Aggregator struct { Id string `json:"id" xorm:"pk"` ProductId string `json:"product_id" xorm:"index"` DeviceId string `json:"device_id" xorm:"index"` Name string `json:"name"` //名称 Desc string `json:"desc"` //说明 Disabled bool `json:"disabled"` //禁用 Created time.Time `json:"created" xorm:"created"` ModAggregator `xorm:"extends"` }
type Alarm ¶
type Alarm struct { Id int64 `json:"id"` Device string `json:"device" xorm:"-"` DeviceId string `json:"device_id" xorm:"index"` Type string `json:"type"` Title string `json:"title"` Message string `json:"message,omitempty"` Level uint `json:"level"` Read bool `json:"read,omitempty"` Created time.Time `json:"created,omitempty" xorm:"created"` }
type App ¶
type App struct { Id string `json:"id" xorm:"pk"` Name string `json:"name"` Icon string `json:"icon,omitempty"` Entries []AppEntry `json:"entries" xorm:"json"` Desc string `json:"desc,omitempty"` Type string `json:"type"` //tcp unix Address string `json:"address"` Auth string `json:"auth"` //鉴权机制,继承 无 自定义,inherit none custom Hidden bool `json:"hidden,omitempty"` //隐藏,适用于服务 }
type AppHistory ¶
type BrokerHistory ¶
type DataType ¶
type DataType int
DataType 数据类型
func (*DataType) UnmarshalJSON ¶
UnmarshalJSON 解析
type Device ¶
type Device struct { Id string `json:"id" xorm:"pk"` //ClientID GatewayId string `json:"gateway_id,omitempty" xorm:"index"` ProductId string `json:"product_id,omitempty" xorm:"index"` Name string `json:"name"` Desc string `json:"desc,omitempty"` Parameters map[string]float64 `json:"parameters,omitempty" xorm:"json"` //模型参数,用于报警检查 Disabled bool `json:"disabled,omitempty"` Created time.Time `json:"created,omitempty" xorm:"created"` Online bool `json:"online,omitempty" xorm:"-"` }
type DeviceEvent ¶ added in v3.0.3
type DeviceHistory ¶
type Gateway ¶ added in v3.0.3
type Gateway struct { Id string `json:"id" xorm:"pk"` Name string `json:"name"` Desc string `json:"desc,omitempty"` Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` Disabled bool `json:"disabled,omitempty"` Created time.Time `json:"created,omitempty" xorm:"created"` }
type ModAggregator ¶ added in v3.2.5
type ModArgument ¶
type ModEvent ¶
type ModEvent struct { Name string `json:"name"` Label string `json:"label"` Desc string `json:"desc,omitempty"` Type string `json:"type"` //info alert error //Level uint8 `json:"level"` Output []ModArgument `json:"output"` }
type ModFunction ¶
type ModFunction struct { Name string `json:"name"` Label string `json:"label"` Desc string `json:"desc,omitempty"` Async bool `json:"async"` Input []ModArgument `json:"input"` Output []ModArgument `json:"output"` }
type ModParameter ¶
type ModProperty ¶
type ModValidator ¶ added in v3.2.5
type ModValidator struct { Expression string `json:"expression"` Type string `json:"type"` Title string `json:"title"` Level uint `json:"level"` Template string `json:"template"` Delay uint `json:"delay,omitempty"` //延迟时间s Again uint `json:"again,omitempty"` //再次提醒间隔s Total uint `json:"total,omitempty"` //总提醒次数 }
type Parameters ¶
type Plugin ¶
type Plugin struct { Id string `json:"id" xorm:"pk"` Name string `json:"name"` Version string `json:"version"` Command string `json:"command,omitempty"` Running bool `json:"running,omitempty" xorm:"-"` Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` External bool `json:"external,omitempty"` Dependencies map[string]string `json:"dependencies,omitempty" xorm:"json"` Disabled bool `json:"disabled,omitempty"` Created time.Time `json:"created,omitempty" xorm:"created"` }
type Product ¶
type Product struct { Id string `json:"id" xorm:"pk"` Name string `json:"name"` Desc string `json:"desc,omitempty"` Version string `json:"version,omitempty"` Properties []ModProperty `json:"properties,omitempty" xorm:"json"` Functions []ModFunction `json:"functions,omitempty" xorm:"json"` Events []ModEvent `json:"events,omitempty" xorm:"json"` Parameters []ModParameter `json:"parameters,omitempty" xorm:"json"` Validators []ModValidator `json:"validators,omitempty" xorm:"json"` Aggregators []ModAggregator `json:"aggregators,omitempty" xorm:"json"` Created time.Time `json:"created,omitempty" xorm:"created"` }
type User ¶
type User struct { Id string `json:"id" xorm:"pk"` Username string `json:"username" xorm:"unique"` Name string `json:"name,omitempty"` Email string `json:"email,omitempty"` Roles []string `json:"roles,omitempty" xorm:"json"` Disabled bool `json:"disabled,omitempty"` Created time.Time `json:"created,omitempty" xorm:"created"` }
User 用户
type UserHistory ¶
Click to show internal directories.
Click to hide internal directories.