messages

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2016 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	FTFireware   string = "1 Firmware Upgrade Image"
	FTWebContent string = "2 Web Content"
	FTConfig     string = "3 Vendor Configuration File"
)

Download type

View Source
const (
	//XsdString string type
	XsdString string = "xsd:string"
	//XsdUnsignedint uint type
	XsdUnsignedint string = "xsd:unsignedInt"
)
View Source
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"
)
View Source
const (
	//SoapArray array type
	SoapArray string = "SOAP-ENC:Array"
)

Variables

This section is empty.

Functions

This section is empty.

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

func (*Download) CreateXML

func (msg *Download) CreateXML() []byte

CreateXML encode xml

func (*Download) GetID

func (msg *Download) GetID() string

GetID get download msg id(tr069 msg id)

func (*Download) GetName

func (msg *Download) GetName() string

GetName name is msg object type, use for decode

func (*Download) Parse

func (msg *Download) Parse(doc *xmlx.Document)

Parse parse from xml

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) GetID

func (msg *DownloadResponse) GetID() string

GetID tr069 msg id

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 FaultStruct

type FaultStruct struct {
	FaultCode   int
	FaultString string
}

FaultStruct error

type GetParameterValues

type GetParameterValues struct {
	ID             string
	Name           string
	NoMore         int
	ParameterNames []string
}

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

type GetParameterValuesResponse struct {
	ID     string
	Name   string
	Values map[string]string
}

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

type GetRPCMethods struct {
	ID     string
	Name   string
	NoMore int
}

GetRPCMethods get rpc methods

func (*GetRPCMethods) CreateXML

func (msg *GetRPCMethods) CreateXML() []byte

CreateXML encode into xml

func (*GetRPCMethods) GetID

func (msg *GetRPCMethods) GetID() string

GetID get msg id

func (*GetRPCMethods) GetName

func (msg *GetRPCMethods) GetName() string

GetName get type name

func (*GetRPCMethods) Parse

func (msg *GetRPCMethods) Parse(doc *xmlx.Document)

Parse decode from xml

type GetRPCMethodsResponse

type GetRPCMethodsResponse struct {
	ID      string
	Name    string
	Methods []string
}

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"`
	Params       map[string]string `json:"params"`
}

Inform tr069 inform (heartbeat)

func NewInform

func NewInform() *Inform

func (*Inform) CreateXML

func (msg *Inform) CreateXML() []byte

CreateXML encode into xml

func (*Inform) GetConfigVersion

func (msg *Inform) GetConfigVersion() (version string)

GetConfigVersion get current config version

func (*Inform) GetID

func (msg *Inform) GetID() string

GetID get msg id

func (*Inform) GetName

func (msg *Inform) GetName() string

GetName get msg type

func (*Inform) GetParam

func (msg *Inform) GetParam(name string) (value string)

GetParam get param in inform

func (*Inform) IsEvent

func (msg *Inform) IsEvent(event string) bool

IsEvent is a connect request or others

func (*Inform) Parse

func (msg *Inform) Parse(doc *xmlx.Document)

Parse decode from xml

type InformResponse

type InformResponse struct {
	ID           string
	Name         string
	NoMore       int
	MaxEnvelopes int
}

InformResponse infrom response

func (*InformResponse) CreateXML

func (msg *InformResponse) CreateXML() []byte

CreateXML encode into xml

func (*InformResponse) GetID

func (msg *InformResponse) GetID() string

GetID get msg id

func (*InformResponse) GetName

func (msg *InformResponse) GetName() string

GetName get msg type

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

func ParseXML

func ParseXML(data []byte) (msg Message, err error)

ParseXML parse xml msg

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) GetID

func (msg *OnlineInform) GetID() string

GetID get msg id

func (*OnlineInform) GetName

func (msg *OnlineInform) GetName() string

GetName get msg type

func (*OnlineInform) Parse

func (msg *OnlineInform) Parse(doc *xmlx.Document)

Parse parse from xml

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 Reboot

type Reboot struct {
	ID         string
	Name       string
	NoMore     int
	CommandKey string
}

Reboot reboot cpe

func (*Reboot) CreateXML

func (msg *Reboot) CreateXML() []byte

CreateXML encode into xml

func (*Reboot) GetID

func (msg *Reboot) GetID() string

GetID get msg id

func (*Reboot) GetName

func (msg *Reboot) GetName() string

GetName get msg name

func (*Reboot) Parse

func (msg *Reboot) Parse(doc *xmlx.Document)

Parse decode from xml

type RebootResponse

type RebootResponse struct {
	ID   string
	Name string
}

RebootResponse reboot response

func (*RebootResponse) CreateXML

func (msg *RebootResponse) CreateXML() []byte

CreateXML encode into xml

func (*RebootResponse) GetID

func (msg *RebootResponse) GetID() string

GetID get msg id

func (*RebootResponse) GetName

func (msg *RebootResponse) GetName() string

GetName get msg type

func (*RebootResponse) Parse

func (msg *RebootResponse) 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) GetID

func (msg *SetParameterValues) GetID() string

GetID get msg id

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

type SetParameterValuesResponse struct {
	ID           string
	Name         string
	Status       int
	ParameterKey string
}

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) GetID

func (msg *TransferComplete) GetID() string

GetID get msg id

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

type TransferCompleteResponse struct {
	ID     string
	Name   string
	NoMore int
}

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 ValueChange

type ValueChange struct {
	Sn    string `json:"sn"`
	Names []string
}

ValueChange value change

func (*ValueChange) CreateXML

func (msg *ValueChange) CreateXML() (xml []byte)

CreateXML encode into xml

func (*ValueChange) GetID

func (msg *ValueChange) GetID() string

GetID get msg id

func (*ValueChange) GetName

func (msg *ValueChange) GetName() string

GetName get msg type

func (*ValueChange) Parse

func (msg *ValueChange) Parse(doc *xmlx.Document)

Parse decode from xml

type ValueStruct

type ValueStruct struct {
	Type  string
	Value string
}

ValueStruct value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL