Documentation ¶
Index ¶
- Variables
- 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 DeviceGroup
- type DeviceHistory
- type DeviceType
- type Gateway
- type License
- type Me
- type ModArgument
- type ModConstraint
- type ModEvent
- type ModFunction
- type ModParameter
- type ModProperty
- type Parameters
- type Password
- type PayloadDevice
- type PayloadEvent
- type PayloadProperties
- type PayloadPropertyUp
- type PayloadValue
- type Plugin
- type Privilege
- type Product
- type Role
- type Time
- func (t *Time) FromDB(b []byte) error
- func (t Time) MarshalJSON() ([]byte, error)
- func (t Time) MarshalText() ([]byte, error)
- func (t Time) Now() Time
- func (t Time) ParseTime(tt time.Time) Time
- func (t Time) String() string
- func (t *Time) ToDB() ([]byte, error)
- func (t *Time) UnmarshalJSON(b []byte) error
- func (t *Time) Value() (driver.Value, error)
- type User
- type UserHistory
- 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 Alarm ¶
type Alarm struct { Id int64 `json:"id"` DeviceId string `json:"device_id" xorm:"index"` Level uint8 `json:"level"` Type string `json:"type"` Title string `json:"title"` Message string `json:"message,omitempty"` Read bool `json:"read,omitempty"` Created 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"` 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"` GroupId int64 `json:"group_id,omitempty" xorm:"index"` //分组 TypeId int64 `json:"type_id,omitempty"` Name string `json:"name"` Desc string `json:"desc,omitempty"` Parameters map[string]float64 `json:"parameters,omitempty"` //模型参数,用于报警检查 Disabled bool `json:"disabled,omitempty"` Created Time `json:"created,omitempty" xorm:"created"` }
type DeviceEvent ¶ added in v3.0.3
type DeviceGroup ¶ added in v3.0.3
type DeviceHistory ¶
type DeviceType ¶ added in v3.0.3
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 `json:"created,omitempty" xorm:"created"` }
type ModArgument ¶
type ModConstraint ¶
type ModConstraint struct { Level uint8 `json:"level"` Type string `json:"type"` Title string `json:"title"` Template string `json:"template"` Expression string `json:"expression"` Delay uint `json:"delay,omitempty"` //延迟时间s Again uint `json:"again,omitempty"` //再次提醒间隔s Total uint `json:"total,omitempty"` //总提醒次数 }
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 Parameters ¶
type PayloadDevice ¶
type PayloadDevice struct { Id string `json:"id"` Time time.Time `json:"time,omitempty"` Timestamp int64 `json:"timestamp,omitempty"` Properties []PayloadValue `json:"properties"` }
type PayloadEvent ¶
type PayloadProperties ¶ added in v3.0.3
type PayloadPropertyUp ¶
type PayloadPropertyUp struct { PayloadDevice //子设备 Devices []PayloadDevice `json:"devices,omitempty"` }
type PayloadValue ¶
type Plugin ¶
type Plugin struct { Id string `json:"id" xorm:"pk"` Name string `json:"name"` Version string `json:"version"` Command string `json:"command,omitempty"` Dependencies map[string]string `json:"dependencies,omitempty" xorm:"json"` Disabled bool `json:"disabled,omitempty"` Created 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"` Constraints []ModConstraint `json:"constraints,omitempty"` Created Time `json:"created,omitempty" xorm:"created"` }
type User ¶
type User struct { Id int64 `json:"id"` Username string `json:"username" xorm:"unique"` Name string `json:"name,omitempty"` Email string `json:"email,omitempty"` Roles []string `json:"roles,omitempty"` Disabled bool `json:"disabled,omitempty"` Created Time `json:"created,omitempty" xorm:"created"` }
User 用户
type UserHistory ¶
Click to show internal directories.
Click to hide internal directories.