Documentation
¶
Index ¶
- Constants
- func Auth(addr, version string, devInfo model.DevInfo) (iotDeviceID string, err error)
- type App
- type Container
- type CpuLmt
- type DiskLmt
- type Download
- type File
- type LinkState
- type MemLmt
- type MemUsed
- type RepPeriod
- type Request
- type Response
- type Service
- type Sign
- type System
- func (sys *System) GetIotCurTime() (time.Time, error)
- func (sys *System) LinkDown(reason string) error
- func (sys *System) LinkUp() error
- func (sys *System) ReportEvent(event model.EventType, info string) error
- func (sys *System) ReportStatus() error
- func (sys *System) Run()
- func (sys *System) Stop()
- type Topo
Constants ¶
View Source
const (
CST = "2006-01-02 15:04:05"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Container ¶
func NewContainer ¶
func NewContainer(edgeID string, tsr transport.Transporter) (*Container, error)
func (*Container) ReportEvent ¶
func (*Container) ReportStatus ¶
type Download ¶
Download 下载文件
func NewDownload ¶
func (*Download) GetProcess ¶
func (*Download) GetState ¶
func (d *Download) GetState() model.UpgradeState
type LinkState ¶
type LinkState struct { Name string `json:"name"` Status model.LinkEnable `json:"status"` }
type Request ¶
type Request struct { Mid int64 `json:"mid,omitempty"` //在请求报文中该值为请求 ID。边设备 接入请求和上报可不携带 DeviceID string `json:"deviceId,omitempty"` //设备唯一标识,涉及批量设备操作时该字段可不填写 App string `json:"app,omitempty"` //APP应用名称,涉及批量设备操作时填写该字段 TimeStamp string `json:"timestamp"` //消息发送的时间戳,CST时间,精度到秒 Expire int `json:"expire,omitempty"` //此报文过期的相对时间(相对timestamp),单位秒,不包含该字段,或者该字段为-1时表示永不过期 Type model.MessageType `json:"type"` //消息类型,全大写,单词中间用“_”隔开 Param interface{} `json:"param"` //报文内容,详见各报文定义 Sign string `json:"sign,omitempty"` //命令及重点信息应包含此字段,该字段为param内容的签名,具体为:对于param中的json成员(包括嵌套json成员)按照key按照字典序排列后进行签名 }
func (*Request) GetMessageType ¶
func (r *Request) GetMessageType() model.MessageType
type Response ¶
type Response struct { Mid int64 `json:"mid"` //在应答报文中,该值为应答所对应请求报文的请求ID DeviceID string `json:"deviceId,omitempty"` //设备唯一标识,涉及批量设备操作时该字段可不填写 TimeStamp string `json:"timestamp"` //消息发送的时间戳,CST时间,精度到秒 Type model.MessageType `json:"type"` //消息类型,全大写,单词中间用“_”隔开 Param interface{} `json:"param,omitempty"` //报文内容,详见各报文定义 Code model.ResponseCode `json:"code"` //标识应答的返回码 Msg string `json:"msg,omitempty"` //应答结果描述,字符串,最大 256 字符 }
func (Response) GetMessageType ¶
func (r Response) GetMessageType() model.MessageType
func (Response) GetParamPayload ¶
func (Response) UnmarshalParam ¶
type Service ¶
type Service struct { GetData func(method string) (interface{}, error) // contains filtered or unexported fields }
func NewService ¶
func NewService(edgeID string, tsr transport.Transporter) (*Service, error)
func (*Service) ReportData ¶
func (*Service) ReportEvent ¶
type System ¶
func NewSystem ¶
func NewSystem(tsr transport.Transporter, devInfo model.DevInfo, systemConfig model.SystemConfig, handle model.OnSysSetConfigHandler) (*System, error)
func (*System) ReportEvent ¶
func (*System) ReportStatus ¶
type Topo ¶
type Topo struct {
// contains filtered or unexported fields
}
func (*Topo) AddTerminal ¶
func (tp *Topo) AddTerminal(terminal model.TerminalInfo) (iotDeviceID string, err error)
func (*Topo) DelTerminal ¶
func (*Topo) UpdateTerminalStatus ¶
func (tp *Topo) UpdateTerminalStatus(deviceID string, status model.DeviceStatus) error
Click to show internal directories.
Click to hide internal directories.