soap

package
v0.0.0-...-cfeb3e9 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: GPL-3.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	NoErrorCode                   = 200
	BadRequestErrorCode           = 400
	InvalidActionErrorCode        = 401
	ActionFailedErrorCode         = 501
	ArgumentValueInvalidErrorCode = 600
)
View Source
const (
	AuthName = "schemas-upnp-org"
	NTEvent  = "upnp:event"

	EncodingStyle = "http://schemas.xmlsoap.org/soap/encoding/"
	EnvelopeNS    = "http://schemas.xmlsoap.org/soap/envelope/"
)

Variables

View Source
var (
	InvalidActionError        = NewErrorf(401, "Invalid Action")
	ArgumentValueInvalidError = NewErrorf(600, "The argument value is invalid")
)

Functions

This section is empty.

Types

type Envelope

type Envelope struct {
	XMLName       xml.Name     `xml:"http://schemas.xmlsoap.org/soap/envelope/ Envelope"`
	EncodingStyle string       `xml:"encodingStyle,attr"`
	Body          EnvelopeBody `xml:"http://schemas.xmlsoap.org/soap/envelope/ Body"`
}

type EnvelopeAction

type EnvelopeAction struct {
	XMLName xml.Name
	Args    []EnvelopeArg
}

type EnvelopeArg

type EnvelopeArg struct {
	XMLName xml.Name
	Value   string `xml:",chardata"`
}

type EnvelopeBody

type EnvelopeBody struct {
	Action []byte `xml:",innerxml"`
}

type EnvelopeResponse

type EnvelopeResponse struct {
	XMLName       xml.Name     `xml:"s:Envelope"`
	XMLSpace      string       `xml:"xmlns:s,attr"`
	EncodingStyle string       `xml:"encodingStyle,attr"`
	Body          EnvelopeBody `xml:"s:Body"`
}

type Error

type Error struct {
	XMLName xml.Name `xml:"urn:schemas-upnp-org:control-1-0 Error"`
	Code    uint     `xml:"errorCode"`
	Desc    string   `xml:"errorDescription"`
}

func NewError

func NewError(code uint, err error) *Error

func NewErrorf

func NewErrorf(code uint, tpl string, args ...interface{}) *Error

func NewFailed

func NewFailed(err error) *Error

func (*Error) Error

func (e *Error) Error() string

type Fault

type Fault struct {
	XMLName     xml.Name    `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault"`
	FaultCode   string      `xml:"faultcode"`
	FaultString string      `xml:"faultstring"`
	Detail      FaultDetail `xml:"detail"`
}

func NewFault

func NewFault(s string, detail interface{}) *Fault

type FaultDetail

type FaultDetail struct {
	XMLName xml.Name `xml:"detail"`
	Data    interface{}
}

type ServiceURN

type ServiceURN struct {
	Auth    string
	Type    string
	Version uint64
}

func ParseServiceURN

func ParseServiceURN(s string) (ret ServiceURN, err error)

func (ServiceURN) String

func (me ServiceURN) String() string

type SoapAction

type SoapAction struct {
	ServiceURN
	Action string
}

func ParseSOAPAction

func ParseSOAPAction(s string) (ret *SoapAction, err error)

type UPnPErrorXML

type UPnPErrorXML struct {
	XMLName xml.Name `xml:"urn:schemas-upnp-org:control-1-0 UPnPError"`
	Code    uint     `xml:"errorCode"`
	Desc    string   `xml:"errorDescription"`
}

Jump to

Keyboard shortcuts

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