Documentation ¶
Index ¶
- Variables
- func MarshalBinBase64(v []byte) (string, error)
- func MarshalBinHex(v []byte) (string, error)
- func MarshalBoolean(v bool) (string, error)
- func MarshalChar(v rune) (string, error)
- func MarshalDate(v time.Time) (string, error)
- func MarshalDateTime(v time.Time) (string, error)
- func MarshalDateTimeTz(v time.Time) (string, error)
- func MarshalFixed14_4(v float64) (string, error)
- func MarshalI1(v int8) (string, error)
- func MarshalI2(v int16) (string, error)
- func MarshalI4(v int32) (string, error)
- func MarshalInt(v int64) (string, error)
- func MarshalR4(v float32) (string, error)
- func MarshalR8(v float64) (string, error)
- func MarshalString(v string) (string, error)
- func MarshalTimeOfDay(v TimeOfDay) (string, error)
- func MarshalTimeOfDayTz(v TimeOfDay) (string, error)
- func MarshalURI(v *url.URL) (string, error)
- func MarshalUi1(v uint8) (string, error)
- func MarshalUi2(v uint16) (string, error)
- func MarshalUi4(v uint32) (string, error)
- func MarshalUi8(v uint64) (string, error)
- func UnmarshalBinBase64(s string) ([]byte, error)
- func UnmarshalBinHex(s string) ([]byte, error)
- func UnmarshalBoolean(s string) (bool, error)
- func UnmarshalChar(s string) (rune, error)
- func UnmarshalDate(s string) (time.Time, error)
- func UnmarshalDateTime(s string) (result time.Time, err error)
- func UnmarshalDateTimeTz(s string) (result time.Time, err error)
- func UnmarshalFixed14_4(s string) (float64, error)
- func UnmarshalI1(s string) (int8, error)
- func UnmarshalI2(s string) (int16, error)
- func UnmarshalI4(s string) (int32, error)
- func UnmarshalInt(s string) (int64, error)
- func UnmarshalR4(s string) (float32, error)
- func UnmarshalR8(s string) (float64, error)
- func UnmarshalString(v string) (string, error)
- func UnmarshalURI(s string) (*url.URL, error)
- func UnmarshalUi1(s string) (uint8, error)
- func UnmarshalUi2(s string) (uint16, error)
- func UnmarshalUi4(s string) (uint32, error)
- func UnmarshalUi8(s string) (uint64, error)
- type SOAPClient
- type SOAPFaultError
- type TimeOfDay
- type TypeData
Constants ¶
This section is empty.
Variables ¶
var TypeDataMap = map[string]TypeData{
"ui1": {"Ui1", "uint8"},
"ui2": {"Ui2", "uint16"},
"ui4": {"Ui4", "uint32"},
"ui8": {"Ui8", "uint64"},
"i1": {"I1", "int8"},
"i2": {"I2", "int16"},
"i4": {"I4", "int32"},
"int": {"Int", "int64"},
"r4": {"R4", "float32"},
"r8": {"R8", "float64"},
"number": {"R8", "float64"},
"fixed.14.4": {"Fixed14_4", "float64"},
"float": {"R8", "float64"},
"char": {"Char", "rune"},
"string": {"String", "string"},
"date": {"Date", "time.Time"},
"dateTime": {"DateTime", "time.Time"},
"dateTime.tz": {"DateTimeTz", "time.Time"},
"time": {"TimeOfDay", "soap.TimeOfDay"},
"time.tz": {"TimeOfDayTz", "soap.TimeOfDay"},
"boolean": {"Boolean", "bool"},
"bin.base64": {"BinBase64", "[]byte"},
"bin.hex": {"BinHex", "[]byte"},
"uri": {"URI", "*url.URL"},
}
TypeDataMap maps from a SOAP type (e.g "fixed.14.4") to its type data.
Functions ¶
func MarshalBinBase64 ¶
MarshalBinBase64 marshals []byte to SOAP "bin.base64" type.
func MarshalBinHex ¶
MarshalBinHex marshals []byte to SOAP "bin.hex" type.
func MarshalBoolean ¶
MarshalBoolean marshals bool to SOAP "boolean" type.
func MarshalChar ¶
MarshalChar marshals rune to SOAP "char" type.
func MarshalDate ¶
MarshalDate marshals time.Time to SOAP "date" type. Note that this converts to local time, and discards the time-of-day components.
func MarshalDateTime ¶
MarshalDateTime marshals time.Time to SOAP "dateTime" type. Note that this converts to local time.
func MarshalDateTimeTz ¶
MarshalDateTimeTz marshals time.Time to SOAP "dateTime.tz" type.
func MarshalFixed14_4 ¶
MarshalFixed14_4 marshals float64 to SOAP "fixed.14.4" type.
func MarshalInt ¶
func MarshalString ¶
func MarshalTimeOfDay ¶
MarshalTimeOfDay marshals TimeOfDay to the "time" type.
func MarshalTimeOfDayTz ¶
MarshalTimeOfDayTz marshals TimeOfDay to the "time.tz" type.
func MarshalURI ¶
MarshalURI marshals *url.URL to SOAP "uri" type.
func MarshalUi1 ¶
func MarshalUi2 ¶
func MarshalUi4 ¶
func MarshalUi8 ¶
func UnmarshalBinBase64 ¶
UnmarshalBinBase64 unmarshals []byte from the SOAP "bin.base64" type.
func UnmarshalBinHex ¶
UnmarshalBinHex unmarshals []byte from the SOAP "bin.hex" type.
func UnmarshalBoolean ¶
UnmarshalBoolean unmarshals bool from the SOAP "boolean" type.
func UnmarshalChar ¶
UnmarshalChar unmarshals rune from SOAP "char" type.
func UnmarshalDate ¶
UnmarshalDate unmarshals time.Time from SOAP "date" type. This outputs the date as midnight in the local time zone.
func UnmarshalDateTime ¶
UnmarshalDateTime unmarshals time.Time from the SOAP "dateTime" type. This returns a value in the local timezone.
func UnmarshalDateTimeTz ¶
UnmarshalDateTimeTz unmarshals time.Time from the SOAP "dateTime.tz" type. This returns a value in the local timezone when the timezone is unspecified.
func UnmarshalFixed14_4 ¶
UnmarshalFixed14_4 unmarshals float64 from SOAP "fixed.14.4" type.
func UnmarshalI1 ¶
func UnmarshalI2 ¶
func UnmarshalI4 ¶
func UnmarshalInt ¶
func UnmarshalR4 ¶
func UnmarshalR8 ¶
func UnmarshalString ¶
func UnmarshalURI ¶
UnmarshalURI unmarshals *url.URL from the SOAP "uri" type.
func UnmarshalUi1 ¶
func UnmarshalUi2 ¶
func UnmarshalUi4 ¶
func UnmarshalUi8 ¶
Types ¶
type SOAPClient ¶
func NewSOAPClient ¶
func NewSOAPClient(endpointURL url.URL) *SOAPClient
func (*SOAPClient) PerformAction ¶
func (client *SOAPClient) PerformAction(actionNamespace, actionName string, inAction interface{}, outAction interface{}) error
PerformAction is the legacy version of PerformActionCtx, which uses context.Background.
func (*SOAPClient) PerformActionCtx ¶ added in v1.0.2
func (client *SOAPClient) PerformActionCtx(ctx context.Context, actionNamespace, actionName string, inAction interface{}, outAction interface{}) error
PerformSOAPAction makes a SOAP request, with the given action. inAction and outAction must both be pointers to structs with string fields only.
type SOAPFaultError ¶
type SOAPFaultError struct { FaultCode string `xml:"faultcode"` FaultString string `xml:"faultstring"` Detail struct { UPnPError struct { Errorcode int `xml:"errorCode"` ErrorDescription string `xml:"errorDescription"` } `xml:"UPnPError"` Raw []byte `xml:",innerxml"` } `xml:"detail"` }
SOAPFaultError implements error, and contains SOAP fault information.
func (*SOAPFaultError) Error ¶
func (err *SOAPFaultError) Error() string
type TimeOfDay ¶
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.
func UnmarshalTimeOfDay ¶
UnmarshalTimeOfDay unmarshals TimeOfDay from the "time" type.
func UnmarshalTimeOfDayTz ¶
UnmarshalTimeOfDayTz unmarshals TimeOfDay from the "time.tz" type.
type TypeData ¶ added in v1.1.0
type TypeData struct {
// contains filtered or unexported fields
}
TypeData provides metadata about for marshalling and unmarshalling a SOAP type.
func (TypeData) GoTypeName ¶ added in v1.1.0
GoTypeName returns the name of the Go type.
func (TypeData) MarshalFunc ¶ added in v1.1.0
MarshalFunc returns the name of the function that marshals the type.
func (TypeData) UnmarshalFunc ¶ added in v1.1.0
UnmarshalFunc returns the name of the function that unmarshals the type.