Documentation ¶
Index ¶
- Constants
- func Decode(reader io.Reader, from, to string) (data []byte, err error)
- func Encode(cmd any, from, to string) ([]byte, error)
- func FormatOmPath(path string) string
- func FormatOmPathPrefix(prefix string) string
- func GetFaultCode(code string) string
- func String(req Requester) string
- type Class
- type Client
- func (own *Client) Close() error
- func (own *Client) Connect() (err error)
- func (own *Client) Request(request Requester) (Responser, error)
- func (own *Client) WithCertificate(cert string) *Client
- func (own *Client) WithPort(port int) *Client
- func (own *Client) WithReadTimeout(timeout int) *Client
- func (own *Client) WithWriteTimeout(timeout int) *Client
- type Command
- type DownloadType
- type Event
- type RequestAddObject
- type RequestDeleteObject
- type RequestDownloadFile
- type RequestFactoryReboot
- type RequestGetValue
- type RequestInformEvent
- type RequestReboot
- type RequestReloadSN
- type RequestResetModule
- type RequestSetCertificate
- type RequestSetValue
- type RequestUploadFile
- type Requester
- type ResetAction
- type Response
- type Responser
- type UploadType
Constants ¶
const ( DEFAULT_PORT = 20300 DEFAULT_READ_TIMEOUT = 60 DEFAULT_WRITE_TIMEOUT = 10 )
const DEFAULT_CERT = "" /* 128-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func FormatOmPath ¶
func FormatOmPathPrefix ¶
func GetFaultCode ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) WithCertificate ¶
func (*Client) WithReadTimeout ¶
func (*Client) WithWriteTimeout ¶
type Command ¶
type Command string
const ( CMD_GET Command = "get" CMD_SET Command = "set" CMD_ADD Command = "add" CMD_DELETE Command = "delete" CMD_REBOOT Command = "reboot" CMD_FACTORY Command = "factory_reboot" CMD_DOWNLOAD Command = "download" CMD_UPLOAD Command = "upload" CMD_RESET Command = "reset" CMD_INFORM Command = "inform" CMD_RELOAD_SN Command = "snReload" )
func (Command) IsMatchClass ¶
type DownloadType ¶
type DownloadType string
********************************************************************************************
const ( DOWNLOAD_TYPE_1 DownloadType = "1 软件包" DOWNLOAD_TYPE_2 DownloadType = "2 配置文件" DOWNLOAD_TYPE_3 DownloadType = "3 普通文件" DOWNLOAD_TYPE_5 DownloadType = "5 Dt omcore log file" DOWNLOAD_TYPE_6 DownloadType = "6 Dt omkeeper log file" DOWNLOAD_TYPE_7 DownloadType = "7 Dt omproxy log file" DOWNLOAD_TYPE_8 DownloadType = "8 Dt proxy log file" DOWNLOAD_TYPE_9 DownloadType = "9 Dt atproxy log file" DOWNLOAD_TYPE_10 DownloadType = "10 Dt xds log file" DOWNLOAD_TYPE_11 DownloadType = "11 Dt all log file" DOWNLOAD_TYPE_12 DownloadType = "12 Data Model File" DOWNLOAD_TYPE_14 DownloadType = "14 Dt ordinary log file" DOWNLOAD_TYPE_15 DownloadType = "15 All configure File" DOWNLOAD_TYPE_18 DownloadType = "18 Dt Alarm Model File" DOWNLOAD_TYPE_19 DownloadType = "19 Dt Exception Model File" DOWNLOAD_TYPE_20 DownloadType = "20 Dt Alarm File" DOWNLOAD_TYPE_21 DownloadType = "21 Dt Exception File" )
type Event ¶
type Event string
********************************************************************************************
const ( INFORM_EVENT_1 Event = "1 boot" INFORM_EVENT_2 Event = "2 periodic" INFORM_EVENT_3 Event = "3 scheduled" INFORM_EVENT_4 Event = "4 value_change" INFORM_EVENT_6 Event = "6 connection request" INFORM_EVENT_8 Event = "8 diagnostics complete" INFORM_EVENT_13 Event = "13 downLoad complete" INFORM_EVENT_14 Event = "14 upload complete" INFORM_EVENT_15 Event = "15 upgrade report" )
type RequestAddObject ¶
********************************************************************************************
func (*RequestAddObject) Generate ¶
func (own *RequestAddObject) Generate() map[string]any
func (*RequestAddObject) GetClass ¶
func (own *RequestAddObject) GetClass() Class
func (*RequestAddObject) GetCommand ¶
func (own *RequestAddObject) GetCommand() Command
type RequestDeleteObject ¶
********************************************************************************************
func (*RequestDeleteObject) Generate ¶
func (own *RequestDeleteObject) Generate() map[string]any
func (*RequestDeleteObject) GetClass ¶
func (own *RequestDeleteObject) GetClass() Class
func (*RequestDeleteObject) GetCommand ¶
func (own *RequestDeleteObject) GetCommand() Command
type RequestDownloadFile ¶
type RequestDownloadFile struct { Key string `json:"key"` // 文件唯一识别码 Url string `json:"url"` FileType DownloadType `json:"file_type"` // 文件类型 FileSize int64 `json:"file_size"` Username string `json:"username"` Password string `json:"password"` DelayTime int64 `json:"delay_time"` }
********************************************************************************************
func (*RequestDownloadFile) Generate ¶
func (own *RequestDownloadFile) Generate() map[string]any
func (*RequestDownloadFile) GetClass ¶
func (own *RequestDownloadFile) GetClass() Class
func (*RequestDownloadFile) GetCommand ¶
func (own *RequestDownloadFile) GetCommand() Command
type RequestFactoryReboot ¶
type RequestFactoryReboot struct {
ResetAll bool
}
********************************************************************************************
func (*RequestFactoryReboot) Generate ¶
func (own *RequestFactoryReboot) Generate() map[string]any
func (*RequestFactoryReboot) GetClass ¶
func (own *RequestFactoryReboot) GetClass() Class
func (*RequestFactoryReboot) GetCommand ¶
func (own *RequestFactoryReboot) GetCommand() Command
type RequestGetValue ¶
********************************************************************************************
func (*RequestGetValue) Generate ¶
func (own *RequestGetValue) Generate() map[string]any
func (*RequestGetValue) GetClass ¶
func (own *RequestGetValue) GetClass() Class
func (*RequestGetValue) GetCommand ¶
func (own *RequestGetValue) GetCommand() Command
type RequestInformEvent ¶
type RequestInformEvent struct {
Event Event
}
********************************************************************************************
func (*RequestInformEvent) Generate ¶
func (own *RequestInformEvent) Generate() map[string]any
func (*RequestInformEvent) GetClass ¶
func (own *RequestInformEvent) GetClass() Class
func (*RequestInformEvent) GetCommand ¶
func (own *RequestInformEvent) GetCommand() Command
type RequestReboot ¶
type RequestReboot struct{}
func (*RequestReboot) Generate ¶
func (own *RequestReboot) Generate() map[string]any
func (*RequestReboot) GetClass ¶
func (own *RequestReboot) GetClass() Class
func (*RequestReboot) GetCommand ¶
func (own *RequestReboot) GetCommand() Command
type RequestReloadSN ¶
type RequestReloadSN struct{}
********************************************************************************************
func (*RequestReloadSN) Generate ¶
func (own *RequestReloadSN) Generate() map[string]any
func (*RequestReloadSN) GetClass ¶
func (own *RequestReloadSN) GetClass() Class
func (*RequestReloadSN) GetCommand ¶
func (own *RequestReloadSN) GetCommand() Command
type RequestResetModule ¶
type RequestResetModule struct { Module string Action ResetAction }
********************************************************************************************
func (*RequestResetModule) Generate ¶
func (own *RequestResetModule) Generate() map[string]any
func (*RequestResetModule) GetClass ¶
func (own *RequestResetModule) GetClass() Class
func (*RequestResetModule) GetCommand ¶
func (own *RequestResetModule) GetCommand() Command
type RequestSetCertificate ¶
type RequestSetCertificate struct {
Cert string
}
********************************************************************************************
func (*RequestSetCertificate) Generate ¶
func (own *RequestSetCertificate) Generate() map[string]any
func (*RequestSetCertificate) GetClass ¶
func (own *RequestSetCertificate) GetClass() Class
func (*RequestSetCertificate) GetCommand ¶
func (own *RequestSetCertificate) GetCommand() Command
type RequestSetValue ¶
********************************************************************************************
func (*RequestSetValue) Generate ¶
func (own *RequestSetValue) Generate() map[string]any
func (*RequestSetValue) GetClass ¶
func (own *RequestSetValue) GetClass() Class
func (*RequestSetValue) GetCommand ¶
func (own *RequestSetValue) GetCommand() Command
type RequestUploadFile ¶
type RequestUploadFile struct { Key string `json:"key"` // 文件唯一识别码 Url string `json:"url"` FileType UploadType `json:"file_type"` // 文件类型 Username string `json:"username"` Password string `json:"password"` DelayTime int64 `json:"delay_time"` StartTime string `json:"start_time"` // 告警异常上传时开始时间 NumberDay int64 `json:"numberDay"` // 告警异常上传几天的文件 }
********************************************************************************************
func (*RequestUploadFile) Generate ¶
func (own *RequestUploadFile) Generate() map[string]any
func (*RequestUploadFile) GetClass ¶
func (own *RequestUploadFile) GetClass() Class
func (*RequestUploadFile) GetCommand ¶
func (own *RequestUploadFile) GetCommand() Command
type ResetAction ¶
type ResetAction string
********************************************************************************************
const ( RESET_ACT_REBOOT ResetAction = "1" // reboot RESET_ACT_ACTIVE ResetAction = "2" // active RESET_ACT_DEACTIVE ResetAction = "3" // deactive )
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
func (*Response) GetValueParamteres ¶
type UploadType ¶
type UploadType string
********************************************************************************************
const ( UPLOAD_TYPE_1 UploadType = "1 Firmware Upgrade Image" UPLOAD_TYPE_2 UploadType = "2 Web Content" UPLOAD_TYPE_3 UploadType = "3 Vendor Configuration File" UPLOAD_TYPE_13 UploadType = "13 Work Order File" UPLOAD_TYPE_16 UploadType = "16 Dt Firmware Upgrade Uu" UPLOAD_TYPE_17 UploadType = "17 Dt Firmware Upgrade Hc" )