Documentation ¶
Index ¶
- Constants
- func ConnectionRequestAuth(username string, password string, uri string) (bool, error)
- func DigestAuthParams(r *http.Response) map[string]string
- func H(data string) string
- func RandomKey() string
- type Download
- type DownloadResponse
- type Envelope
- type EventNodeStruct
- type EventStruct
- type FactoryReset
- type FactoryResetResponse
- type FaultStruct
- type GetParameterNames
- type GetParameterNamesResponse
- type GetParameterNamesResponseBodyStruct
- type GetParameterNamesResponseStruct
- type GetParameterValues
- type GetParameterValuesResponse
- type GetRPCMethods
- type GetRPCMethodsResponse
- type HeaderStruct
- type IDStruct
- type Inform
- func (msg *Inform) CreateXML() []byte
- func (msg *Inform) GetConfigVersion() (version string)
- func (msg *Inform) GetID() string
- func (msg *Inform) GetName() string
- func (msg *Inform) GetParam(name string) (value string)
- func (msg *Inform) GetSoftwareVersion() (version string)
- func (msg *Inform) IsEvent(event string) bool
- func (msg *Inform) Parse(doc *xmlx.Document)
- type InformMessage
- type InformResponse
- type Message
- type NodeStruct
- type OnlineInform
- type ParameterInfoStruct
- type ParameterListStruct
- type ParameterValueStruct
- type Reboot
- type RebootResponse
- type ScheduleInform
- type ScheduleInformResponse
- type SetParameterValues
- type SetParameterValuesResponse
- type TransferComplete
- type TransferCompleteResponse
- type Upload
- type UploadResponse
- type ValueChange
- type ValueStruct
Constants ¶
const ( FTFireware string = "1 Firmware Upgrade Image" FTWebContent string = "2 Web Content" FTConfig string = "3 Vendor Configuration File" )
Download type
const ( // XsdString string type XsdString string = "xsd:string" // XsdUnsignedint uint type XsdUnsignedint string = "xsd:unsignedInt" )
const ( // EventBootStrap first connection EventBootStrap string = "0 BOOTSTRAP" // EventBoot reset or power on EventBoot string = "1 BOOT" // EventPeriodic periodic inform EventPeriodic string = "2 PERIODIC" // EventScheduled scheduled infrorm EventScheduled string = "3 SCHEDULED" // EventValueChange value change event EventValueChange string = "4 VALUE CHANGE" // EventKicked acs notify cpe EventKicked string = "5 KICKED" // EventConnectionRequest cpe request connection EventConnectionRequest string = "6 CONNECTION REQUEST" // EventTransferComplete download complete EventTransferComplete string = "7 TRANSFER COMPLETE" // EventClientChange custom event client online/offline EventClientChange string = "8 CLIENT CHANGE" )
const ( VendorMikrotik = "14988" VendorH3C = "25506" VendorHuawei = "2011" VendorRuijie = "4881" )
const ( // SoapArray array type SoapArray string = "soap-enc:Array" )
Variables ¶
This section is empty.
Functions ¶
func ConnectionRequestAuth ¶
func DigestAuthParams ¶
Parse Authorization header from the http.Request. Returns a map of auth parameters or nil if the header is not a valid parsable Digest auth header.
Types ¶
type Download ¶
type Download struct { ID string Name string NoMore int CommandKey string FileType string URL string Username string Password string FileSize int TargetFileName string DelaySeconds int SuccessURL string FailureURL string }
Download tr069 download msg
type DownloadResponse ¶
type DownloadResponse struct { ID string Name string Status int StartTime string CompleteTime string }
DownloadResponse download response
func (*DownloadResponse) CreateXML ¶
func (msg *DownloadResponse) CreateXML() []byte
CreateXML encode into xml
func (*DownloadResponse) GetName ¶
func (msg *DownloadResponse) GetName() string
GetName msg type name
func (*DownloadResponse) Parse ¶
func (msg *DownloadResponse) Parse(doc *xmlx.Document)
Parse decode into struct
type Envelope ¶
type Envelope struct { XMLName xml.Name `xml:"soap-env:Envelope"` XmlnsEnv string `xml:"xmlns:soap-env,attr"` XmlnsEnc string `xml:"xmlns:soap-enc,attr"` XmlnsXsd string `xml:"xmlns:xsd,attr"` XmlnsXsi string `xml:"xmlns:xsi,attr"` XmlnsCwmp string `xml:"xmlns:cwmp,attr"` Header interface{} `xml:"soap-env:Header"` Body interface{} `xml:"soap-env:Body"` }
Envelope tr069 body
type EventNodeStruct ¶
type EventNodeStruct struct { EventCode NodeStruct `xml:"EventCode"` CommandKey string `xml:"CommandKey"` }
EventNodeStruct event node
type EventStruct ¶
type EventStruct struct { Type string `xml:"soap-enc:arrayType,attr"` Events []EventNodeStruct `xml:"EventStruct"` }
EventStruct event
type FactoryReset ¶
FactoryReset cpe
func (*FactoryReset) CreateXML ¶
func (msg *FactoryReset) CreateXML() []byte
CreateXML encode into xml
func (*FactoryReset) Parse ¶
func (msg *FactoryReset) Parse(doc *xmlx.Document)
Parse decode from xml
type FactoryResetResponse ¶
FactoryResetResponse
func (*FactoryResetResponse) CreateXML ¶
func (msg *FactoryResetResponse) CreateXML() []byte
CreateXML encode into xml
func (*FactoryResetResponse) GetID ¶
func (msg *FactoryResetResponse) GetID() string
GetID get msg id
func (*FactoryResetResponse) GetName ¶
func (msg *FactoryResetResponse) GetName() string
GetName get msg type
func (*FactoryResetResponse) Parse ¶
func (msg *FactoryResetResponse) Parse(doc *xmlx.Document)
Parse decode from xml
type GetParameterNames ¶
type GetParameterNames struct { ID string Name string NoMore int ParameterPath string NextLevel string }
GetParameterNames get rpc methods
func (*GetParameterNames) CreateXML ¶
func (msg *GetParameterNames) CreateXML() []byte
CreateXML encode into xml
func (*GetParameterNames) GetName ¶
func (msg *GetParameterNames) GetName() string
GetName get type name
func (*GetParameterNames) Parse ¶
func (msg *GetParameterNames) Parse(doc *xmlx.Document)
Parse decode from xml
type GetParameterNamesResponse ¶
type GetParameterNamesResponse struct { ID string Name string Params []ParameterInfoStruct }
GetParameterNamesResponse GetParameterNames reponse
func (*GetParameterNamesResponse) CreateXML ¶
func (msg *GetParameterNamesResponse) CreateXML() []byte
CreateXML encode into xml
func (*GetParameterNamesResponse) GetID ¶
func (msg *GetParameterNamesResponse) GetID() string
GetID get msg id
func (*GetParameterNamesResponse) GetName ¶
func (msg *GetParameterNamesResponse) GetName() string
GetName get msg type
func (*GetParameterNamesResponse) Parse ¶
func (msg *GetParameterNamesResponse) Parse(doc *xmlx.Document)
Parse decode from xml
type GetParameterNamesResponseBodyStruct ¶
type GetParameterNamesResponseBodyStruct struct {
Body GetParameterNamesResponseStruct `xml:"cwmp:GetParameterNamesResponse"`
}
type GetParameterNamesResponseStruct ¶
type GetParameterNamesResponseStruct struct {
ParameterList ParameterListStruct `xml:"cwmp:ParameterList"`
}
type GetParameterValues ¶
GetParameterValues get paramvalues
func (*GetParameterValues) CreateXML ¶
func (msg *GetParameterValues) CreateXML() []byte
CreateXML encode into xml
func (*GetParameterValues) GetID ¶
func (msg *GetParameterValues) GetID() string
GetID get tr069 msg id
func (*GetParameterValues) GetName ¶
func (msg *GetParameterValues) GetName() string
GetName get type name
func (*GetParameterValues) Parse ¶
func (msg *GetParameterValues) Parse(doc *xmlx.Document)
Parse decode from xml
type GetParameterValuesResponse ¶
GetParameterValuesResponse getParameterValues response
func NewGetParameterValuesResponse ¶
func NewGetParameterValuesResponse() (m *GetParameterValuesResponse)
NewGetParameterValuesResponse create GetParameterValuesResponse object
func (*GetParameterValuesResponse) CreateXML ¶
func (msg *GetParameterValuesResponse) CreateXML() []byte
CreateXML encode into xml
func (*GetParameterValuesResponse) GetID ¶
func (msg *GetParameterValuesResponse) GetID() string
GetID get msg id
func (*GetParameterValuesResponse) GetName ¶
func (msg *GetParameterValuesResponse) GetName() string
GetName get type name
func (*GetParameterValuesResponse) Parse ¶
func (msg *GetParameterValuesResponse) Parse(doc *xmlx.Document)
Parse decode from xml
type GetRPCMethods ¶
GetRPCMethods get rpc methods
func (*GetRPCMethods) CreateXML ¶
func (msg *GetRPCMethods) CreateXML() []byte
CreateXML encode into xml
func (*GetRPCMethods) Parse ¶
func (msg *GetRPCMethods) Parse(doc *xmlx.Document)
Parse decode from xml
type GetRPCMethodsResponse ¶
GetRPCMethodsResponse getRPCMethods reponse
func (*GetRPCMethodsResponse) CreateXML ¶
func (msg *GetRPCMethodsResponse) CreateXML() []byte
CreateXML encode into xml
func (*GetRPCMethodsResponse) GetID ¶
func (msg *GetRPCMethodsResponse) GetID() string
GetID get msg id
func (*GetRPCMethodsResponse) GetName ¶
func (msg *GetRPCMethodsResponse) GetName() string
GetName get msg type
func (*GetRPCMethodsResponse) Parse ¶
func (msg *GetRPCMethodsResponse) Parse(doc *xmlx.Document)
Parse decode from xml
type HeaderStruct ¶
type HeaderStruct struct { ID IDStruct `xml:"cwmp:ID"` NoMore interface{} `xml:"cwmp:NoMoreRequests,ommitempty"` }
HeaderStruct tr069 header
type IDStruct ¶
type IDStruct struct { Attr string `xml:"soap-env:mustUnderstand,attr,ommitempty"` Value string `xml:",chardata"` }
IDStruct msg id
type Inform ¶
type Inform struct { ID string `json:"id"` Name string `json:"name"` Manufacturer string `json:"manufacturer"` OUI string `json:"oui"` ProductClass string `json:"productClass"` Sn string `json:"sn"` Events map[string]string `json:"events"` MaxEnvelopes int `json:"maxEnvelopes"` CurrentTime string `json:"currentTime"` RetryCount int `json:"retryCount"` CommandKey string `json:"commandKey"` Params map[string]string `json:"params"` }
Inform tr069 inform (heartbeat)
func (*Inform) GetConfigVersion ¶
GetConfigVersion get current config version
func (*Inform) GetSoftwareVersion ¶
type InformMessage ¶
InformMessage used to store device inform
type InformResponse ¶
InformResponse infrom response
func (*InformResponse) CreateXML ¶
func (msg *InformResponse) CreateXML() []byte
CreateXML encode into xml
func (*InformResponse) Parse ¶
func (msg *InformResponse) Parse(doc *xmlx.Document)
Parse decode from xml
type Message ¶
type Message interface { Parse(doc *xmlx.Document) CreateXML() []byte GetName() string GetID() string }
Message tr069 msg interface
type NodeStruct ¶
type NodeStruct struct { Type interface{} `xml:"xsi:type,attr"` Value string `xml:",chardata"` }
NodeStruct node
type OnlineInform ¶
type OnlineInform struct { Sn string `json:"sn"` Hosts []host }
OnlineInform online client
func (*OnlineInform) CreateXML ¶
func (msg *OnlineInform) CreateXML() (xml []byte)
CreateXML encode into xml
func (*OnlineInform) Parse ¶
func (msg *OnlineInform) Parse(doc *xmlx.Document)
Parse parse from xml
type ParameterInfoStruct ¶
type ParameterListStruct ¶
type ParameterListStruct struct { Type string `xml:"soap-enc:arrayType,attr"` Params []ParameterValueStruct `xml:"ParameterValueStruct"` }
ParameterListStruct param list
type ParameterValueStruct ¶
type ParameterValueStruct struct { Name NodeStruct `xml:"Name"` Value NodeStruct `xml:"Value"` }
ParameterValueStruct param value
type RebootResponse ¶
RebootResponse reboot response
func (*RebootResponse) CreateXML ¶
func (msg *RebootResponse) CreateXML() []byte
CreateXML encode into xml
func (*RebootResponse) Parse ¶
func (msg *RebootResponse) Parse(doc *xmlx.Document)
Parse decode from xml
type ScheduleInform ¶
ScheduleInform cpe
func (*ScheduleInform) CreateXML ¶
func (msg *ScheduleInform) CreateXML() []byte
CreateXML encode into xml
func (*ScheduleInform) Parse ¶
func (msg *ScheduleInform) Parse(doc *xmlx.Document)
Parse decode from xml
type ScheduleInformResponse ¶
ScheduleInformResponse resp
func (*ScheduleInformResponse) CreateXML ¶
func (msg *ScheduleInformResponse) CreateXML() []byte
CreateXML encode into xml
func (*ScheduleInformResponse) GetID ¶
func (msg *ScheduleInformResponse) GetID() string
GetID get msg id
func (*ScheduleInformResponse) GetName ¶
func (msg *ScheduleInformResponse) GetName() string
GetName get msg type
func (*ScheduleInformResponse) Parse ¶
func (msg *ScheduleInformResponse) Parse(doc *xmlx.Document)
Parse decode from xml
type SetParameterValues ¶
type SetParameterValues struct { ID string Name string NoMore int Params map[string]ValueStruct ParameterKey string }
SetParameterValues set param
func (*SetParameterValues) CreateXML ¶
func (msg *SetParameterValues) CreateXML() []byte
CreateXML encode into xml
func (*SetParameterValues) GetName ¶
func (msg *SetParameterValues) GetName() string
GetName get msg type
func (*SetParameterValues) Parse ¶
func (msg *SetParameterValues) Parse(doc *xmlx.Document)
Parse decode from xml
type SetParameterValuesResponse ¶
SetParameterValuesResponse set param reponse
func (*SetParameterValuesResponse) CreateXML ¶
func (msg *SetParameterValuesResponse) CreateXML() []byte
CreateXML encode into xml
func (*SetParameterValuesResponse) GetID ¶
func (msg *SetParameterValuesResponse) GetID() string
GetID get msg id
func (*SetParameterValuesResponse) GetName ¶
func (msg *SetParameterValuesResponse) GetName() string
GetName get msg type
func (*SetParameterValuesResponse) Parse ¶
func (msg *SetParameterValuesResponse) Parse(doc *xmlx.Document)
Parse decode from xml
type TransferComplete ¶
type TransferComplete struct { ID string Name string CommandKey string StartTime string CompleteTime string FaultCode int FaultString string }
TransferComplete download complete
func (*TransferComplete) CreateXML ¶
func (msg *TransferComplete) CreateXML() []byte
CreateXML encode into mxl
func (*TransferComplete) GetName ¶
func (msg *TransferComplete) GetName() string
GetName get msg type
func (*TransferComplete) Parse ¶
func (msg *TransferComplete) Parse(doc *xmlx.Document)
Parse decode from xml
type TransferCompleteResponse ¶
TransferCompleteResponse transferComplete response
func (*TransferCompleteResponse) CreateXML ¶
func (msg *TransferCompleteResponse) CreateXML() []byte
CreateXML encode into xml
func (*TransferCompleteResponse) GetID ¶
func (msg *TransferCompleteResponse) GetID() string
GetID get msg id
func (*TransferCompleteResponse) GetName ¶
func (msg *TransferCompleteResponse) GetName() string
GetName get msg name
func (*TransferCompleteResponse) Parse ¶
func (msg *TransferCompleteResponse) Parse(doc *xmlx.Document)
Parse decode from xml
type Upload ¶
type Upload struct { ID string Name string NoMore int CommandKey string FileType string URL string Username string Password string DelaySeconds int }
Upload tr069 upload msg
type UploadResponse ¶
type UploadResponse struct { ID string Name string Status int StartTime string CompleteTime string }
UploadResponse upload response
func (*UploadResponse) CreateXML ¶
func (msg *UploadResponse) CreateXML() []byte
CreateXML encode into xml
func (*UploadResponse) Parse ¶
func (msg *UploadResponse) Parse(doc *xmlx.Document)
Parse decode into struct
type ValueChange ¶
ValueChange value change
func (*ValueChange) CreateXML ¶
func (msg *ValueChange) CreateXML() (xml []byte)
CreateXML encode into xml
Source Files ¶
- Download.go
- DownloadResponse.go
- FactoryReset.go
- FactoryResetResponse.go
- GetParameterNames.go
- GetParameterNamesResponse.go
- GetParameterValues.go
- GetParameterValuesResponse.go
- GetRPCMethods.go
- GetRPCMethodsResponse.go
- Inform.go
- InformResponse.go
- Message.go
- Model.go
- OnlineInform.go
- Parser.go
- Reboot.go
- RebootResponse.go
- ScheduleInform.go
- ScheduleInformResponse.go
- SetParameterValues.go
- SetParameterValuesResponse.go
- TransferComplete.go
- TransferCompleteResponse.go
- Upload.go
- UploadResponse.go
- ValueChange.go
- auth_client.go
- constants.go
- utils.go