soap

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package soap implements data types for SOAP messages

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Arguments []Argument `xml:",any"`
}

Action represents a SOAP action

type ActionResponse

type ActionResponse struct {
	ServiceType    string
	ServiceVersion string
	Name           string
	Arguments      ResponseArguments
}

ActionResponse represents a response to a SOAP action

func (ActionResponse) Marshal

func (me ActionResponse) Marshal() []byte

Marshal marshals an XML snippet for an response to a SOAP action

type Argument

type Argument struct {
	Name  string
	Value string
}

Argument represents an argument of a SOAP action

func (*Argument) UnmarshalXML

func (me *Argument) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML unmarshals an argument of a SOAP action

type Body

type Body struct {
	Content []byte `xml:",innerxml"`
}

Body represents a SOAP body

type Envelope

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

Envelope represents a SOAP envelope

func (Envelope) Marshal

func (me Envelope) Marshal() []byte

Marshal marshals an XML snippet for a SOAP Body

type Error

type Error struct {
	Code UPnPErrorCode
	Desc string
}

Error represents a SOAP error

func (Error) IsNil

func (me Error) IsNil() bool

IsNil returns true is the SOAP error not really an error

func (Error) Marshal

func (me Error) Marshal() []byte

Marshal marshals an XML snippet for a SOAP error

type ResponseArguments

type ResponseArguments map[string]string

ResponseArguments maps argument name to argument value

type TimeOfDay added in v0.1.1

type TimeOfDay struct {
	// Duration of time since midnight.
	FromMidnight time.Duration

	// Set to true if Offset is specified. If false, then the timezone is
	// unspecified (and by ISO8601 - implies some "local" time).
	HasOffset bool

	// Offset is non-zero only if time.tz is used. It is otherwise ignored. If
	// non-zero, then it is regarded as a UTC offset in seconds. Note that the
	// sub-minutes is ignored by the marshal function.
	Offset int
}

TimeOfDay is used in cases where SOAP "time" or "time.tz" is used. This type definition is copied from https://github.com/huin/goupnp, copyright 2013 John Beisley <johnbeisleyuk@gmail.com>.

type UPnPErrorCode

type UPnPErrorCode uint

UPnPErrorCode represents an UPnP error code

const (
	// UPnPErrorInvalidAction is the code foran invalid action
	UPnPErrorInvalidAction UPnPErrorCode = 400
	// UPnPErrorInvalidArgs is the code for invalid arguments
	UPnPErrorInvalidArgs UPnPErrorCode = 402
	// UPnPErrorActionFailed is the code for a failed action
	UPnPErrorActionFailed UPnPErrorCode = 501
	// UPnPErrorArgValInvalid is the code for an invalid argument value
	UPnPErrorArgValInvalid UPnPErrorCode = 600
	// UPnPErrorArgValOutOfRange is the code for an argument value that is out
	// of range
	UPnPErrorArgValOutOfRange UPnPErrorCode = 601
	// UPnPErrorOptActionNotImplemented is the code for an action that is
	// called but not implemented
	UPnPErrorOptActionNotImplemented UPnPErrorCode = 602
	// UPnPErrorHumanRequired indicates that human interaction is required
	UPnPErrorHumanRequired UPnPErrorCode = 604
	// UPnPErrorStrTooLong indicates that a string is too long
	UPnPErrorStrTooLong UPnPErrorCode = 605
)

Jump to

Keyboard shortcuts

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