Documentation ¶
Index ¶
- Constants
- Variables
- func FormatOmPath(path string) string
- func NewCertficateRequest() *certificateRequest
- func NewFactoryRequest() *factoryRequest
- func NewFileRequest() *fileRequest
- func NewObjectRequest() *objectRequest
- func NewRebootRequest() *rebootRequest
- func NewValueRequest() *valueRequest
- func QueryFaultCode(code string) string
- type Class
- type Client
- func (own *Client) Close() error
- func (own *Client) ConnectAndAuth() (err error)
- func (own *Client) Execute(cmd any) (Responser, error)
- func (own *Client) Send(req 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 Codec
- type Command
- type FileType
- type Requester
- type Responser
Constants ¶
View Source
const (
STATUS_OK = "1"
)
Variables ¶
View Source
var ( DefaultPort = 20300 DefaultReadTimeout = 5 DefaultWriteTimeout = 5 )
View Source
var DefaultCert = "" /* 128-byte string literal not displayed */
DefaultCert OM 协议默认的证书
Functions ¶
func FormatOmPath ¶
func NewCertficateRequest ¶
func NewCertficateRequest() *certificateRequest
NewCertficateCommand 创建OM协议的认证指令
func NewFactoryRequest ¶
func NewFactoryRequest() *factoryRequest
func NewFileRequest ¶
func NewFileRequest() *fileRequest
func NewObjectRequest ¶
func NewObjectRequest() *objectRequest
func NewRebootRequest ¶
func NewRebootRequest() *rebootRequest
func NewValueRequest ¶
func NewValueRequest() *valueRequest
func QueryFaultCode ¶
Types ¶
type Class ¶
type Class string
Class 定义OM消息类型的结构
func (Class) IsMatchCommand ¶
IsMatchCommand 判断消息类型是否匹配命令
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client 定义OM客户端的数据结构
func (*Client) ConnectAndAuth ¶
ConnectAndAuth 连接并认证
func (*Client) WithCertificate ¶
WithCertificate 设置OM连接的认证证书
func (*Client) WithReadTimeout ¶
WithReadTimeout 设置OM连接的读超时时间
func (*Client) WithWriteTimeout ¶
WithWriteTimeout 设置OM连接的写超时时间
type Command ¶
type Command string
Command 定义OM消息命令的结构
const ( CMD_NONE Command = "" // 请求命令 CMD_REQ_GET Command = "get" // 查询 CMD_REQ_SET Command = "set" // 设置 CMD_REQ_ADD Command = "add" // 添加 CMD_REQ_DELETE Command = "delete" // 删除 CMD_REQ_REBOOT Command = "reboot" // 重启 CMD_REQ_FACTORY Command = "factory_reboot" // 重置 CMD_REQ_UPLOAD Command = "upload" // 上传 CMD_REQ_DOWNLOAD Command = "download" // 下载 // 响应命令 CMD_RESP_GET Command = "get_rsp" // 查询 CMD_RESP_SET Command = "set_rsp" // 设置 CMD_RESP_ADD Command = "add_rsp" // 添加 CMD_RESP_DELETE Command = "delete_rsp" // 删除 CMD_RESQ_REBOOT Command = "reboot_rsp" // 重启 CMD_RESP_UPLOAD Command = "upload_rsp" // 上传 CMD_RESP_DOWNLOAD Command = "download_rsp" // 下载 )
func (Command) IsMatchCommand ¶
func (Command) IsRequestCommand ¶
IsRequestCommand 判断是否为请求命令
func (Command) IsResponseCommand ¶
IsResponseCommand 判断是否为响应命令
type FileType ¶
type FileType string
const ( UPLOAD_TYPE_1 FileType = "1 Firmware Upgrade Image" UPLOAD_TYPE_2 FileType = "2 Web Content" UPLOAD_TYPE_3 FileType = "3 Vendor Configuration File" UPLOAD_TYPE_13 FileType = "13 Work Order File" UPLOAD_TYPE_16 FileType = "16 Dt Firmware Upgrade Uu" UPLOAD_TYPE_17 FileType = "17 Dt Firmware Upgrade Hc" DOWNLOAD_TYPE_1 FileType = "1 软件包" DOWNLOAD_TYPE_2 FileType = "2 配置文件" DOWNLOAD_TYPE_3 FileType = "3 普通文件" DOWNLOAD_TYPE_5 FileType = "5 Dt omcore log file" DOWNLOAD_TYPE_6 FileType = "6 Dt omkeeper log file" DOWNLOAD_TYPE_7 FileType = "7 Dt omproxy log file" DOWNLOAD_TYPE_8 FileType = "8 Dt proxy log file" DOWNLOAD_TYPE_9 FileType = "9 Dt atproxy log file" DOWNLOAD_TYPE_10 FileType = "10 Dt xds log file" DOWNLOAD_TYPE_11 FileType = "11 Dt all log file" DOWNLOAD_TYPE_12 FileType = "12 Data Model File" DOWNLOAD_TYPE_13 FileType = "14 Dt ordinary log file" DOWNLOAD_TYPE_14 FileType = "15 All configure File" DOWNLOAD_TYPE_15 FileType = "18 Dt Alarm Model File" DOWNLOAD_TYPE_16 FileType = "19 Dt Exception Model File" DOWNLOAD_TYPE_17 FileType = "20 Dt Alarm File" DOWNLOAD_TYPE_18 FileType = "21 Dt Exception File" )
func (FileType) IsDownloadType ¶
func (FileType) IsUploadType ¶
Click to show internal directories.
Click to hide internal directories.