Documentation ¶
Overview ¶
Package control implements control functions of UPnP for net-upnp-go.
Index ¶
Constants ¶
const ( ErrorInvalidAction = 401 ErrorInvalidArgs = 402 ErrorActionFailed = 501 ErrorArgumentValueInvalid = 600 ErrorArgumentValueOutOfRange = 601 ErrorOptionalActionNotImplemented = 602 ErrorOutOfMemory = 603 ErrorHumanInterventionRequired = 604 ErrorStringArgumentTooLong = 605 )
const (
ResponseSuffix = "Response"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionControl ¶
type ActionControl struct {
Envelope Envelope `xml:"Envelope"`
}
A ActionControl represents an action Control.
func NewActionControl ¶
func NewActionControl() *ActionControl
NewActionControl returns a new Control.
func (*ActionControl) GetAction ¶
func (action *ActionControl) GetAction() (*Action, error)
GetAction returns an actions in the SOAP Control.
func (*ActionControl) SOAPContentString ¶
func (action *ActionControl) SOAPContentString() (string, error)
SOAPContent returns a SOAP content string.
type ActionInnerXML ¶
type ActionInnerXML struct {
Innerxml string `xml:",innerxml"`
}
A Action represents arguments in as SOAP action.
type ActionRequest ¶
type ActionRequest struct {
*ActionControl
}
A ActionRequest represents an action request.
func NewActionRequest ¶
func NewActionRequest() *ActionRequest
NewActionRequest returns a new Request.
func NewActionRequestFromSOAPBytes ¶
func NewActionRequestFromSOAPBytes(soapReq []byte) (*ActionRequest, error)
NewActionRequestFromSOAPString returns a new Request.
type ActionResponse ¶
type ActionResponse struct {
*ActionControl
}
A ActionResponse represents an action request.
func NewActionResponse ¶
func NewActionResponse() *ActionResponse
NewActionResponse returns a new response.
func NewActionResponseFromSOAPBytes ¶
func NewActionResponseFromSOAPBytes(soapRes []byte) (*ActionResponse, error)
NewActionResponseFromSOAPString returns a new response.
type Envelope ¶
type Envelope struct { XMLName xml.Name `xml:"Envelope"` Body struct { XMLName xml.Name `xml:"Body"` Innerxml string `xml:",innerxml"` Action Action } }
A Envelope represents an Envelope.
func (*Envelope) MarshalXML ¶
type ErrorEnvelope ¶
type ErrorEnvelope struct { XMLName xml.Name `xml:"http://schemas.xmlsoap.org/soap/envelope/ Envelope"` Body struct { XMLName xml.Name `xml:"http://schemas.xmlsoap.org/soap/envelope/ Body"` Fault struct { XMLName xml.Name `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault"` FaultCode string `xml:"faultcode"` FaultString string `xml:"faultstring"` Detail struct { XMLName xml.Name `xml:"detail"` UPnPError UPnPError `xml:"urn:schemas-upnp-org:control-1-0 UPnPError"` } } } }
A ErrorEnvelope represents an Envelope for error response.
func (*ErrorEnvelope) MarshalXML ¶
func (ev *ErrorEnvelope) MarshalXML(e *xml.Encoder, env xml.StartElement) error
type ErrorResponse ¶
type ErrorResponse struct {
Envelope ErrorEnvelope `xml:"Envelope"`
}
A ErrorResponse represents an error response.
func NewErrorResponse ¶
func NewErrorResponse() *ErrorResponse
NewErrorResponse returns a new error response.
func NewErrorResponseFromSOAPBytes ¶
func NewErrorResponseFromSOAPBytes(soapStr []byte) (*ErrorResponse, error)
NewErrorResponseFromSOAPString returns a new error response.
func NewErrorResponseFromUPnPError ¶
func NewErrorResponseFromUPnPError(upnpError *UPnPError) *ErrorResponse
NewErrorResponseFromUPnPError returns a new error response.
func (*ErrorResponse) GetUPnPError ¶
func (res *ErrorResponse) GetUPnPError() (*UPnPError, error)
GetUPnPError returns an UPnP error.
func (*ErrorResponse) SOAPContentString ¶
func (res *ErrorResponse) SOAPContentString() (string, error)
SOAPContent returns a SOAP content string.
type UPnPError ¶
type UPnPError struct { XMLName xml.Name `xml:"urn:schemas-upnp-org:control-1-0 UPnPError"` Code int `xml:"errorCode"` Description string `xml:"errorDescription"` }
func NewUPnPErrorFromCode ¶
NewUPnPErrorFromCode returns a new UPnPError from the specified code.