xmlsrvdesc

package
v0.0.0-...-5a65ac4 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package xmlsrvdesc contains the XML data structures used in SCPD (Service Control Protocol Description).

Described in section 2.5 of https://openconnectivity.org/upnp-specs/UPnP-arch-DeviceArchitecture-v2.0-20200417.pdf.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Optional  PresenceBool
	Name      string      `xml:"name"`
	Arguments []*Argument `xml:"argumentList>argument"`
}

Action XML description data.

func (*Action) Clean

func (action *Action) Clean()

Clean removes stray whitespace in the structure.

type AllowedValueRange

type AllowedValueRange struct {
	Minimum string `xml:"minimum"`
	Maximum string `xml:"maximum"`
	Step    string `xml:"step"`
}

AllowedValueRange XML data.

func (*AllowedValueRange) Clean

func (r *AllowedValueRange) Clean()

Clean removes stray whitespace in the structure.

type Argument

type Argument struct {
	Name                 string `xml:"name"`
	Direction            string `xml:"direction"`            // in|out
	RelatedStateVariable string `xml:"relatedStateVariable"` // ?
	Retval               string `xml:"retval"`               // ?
}

Argument XML data.

func (*Argument) Clean

func (arg *Argument) Clean()

Clean removes stray whitespace in the structure.

type DataType

type DataType struct {
	Name string `xml:",chardata"`
	Type string `xml:"type,attr"`
}

DataType XML data.

func (*DataType) Clean

func (dt *DataType) Clean()

Clean removes stray whitespace in the structure.

type PresenceBool

type PresenceBool bool

PresenceBool represents an empty XML element that is true if present.

Is an error if it contains any attributes or contents.

func (*PresenceBool) UnmarshalXML

func (pb *PresenceBool) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type SCPD

type SCPD struct {
	XMLName        xml.Name         `xml:"scpd"`
	ConfigId       string           `xml:"configId,attr"`
	SpecVersion    SpecVersion      `xml:"specVersion"`
	Actions        []*Action        `xml:"actionList>action"`
	StateVariables []*StateVariable `xml:"serviceStateTable>stateVariable"`
}

SCPD is the top level XML service description.

func (*SCPD) Clean

func (scpd *SCPD) Clean()

Clean removes stray whitespace in the structure.

It's common for stray whitespace to be present in SCPD documents, this method removes them in-place.

type SpecVersion

type SpecVersion struct {
	Major int32 `xml:"major"`
	Minor int32 `xml:"minor"`
}

SpecVersion is part of a SCPD document, describes the version of the specification that the data adheres to.

type StateVariable

type StateVariable struct {
	Optional          PresenceBool
	Name              string             `xml:"name"`
	SendEvents        string             `xml:"sendEvents,attr"` // yes|no
	Multicast         string             `xml:"multicast,attr"`  // yes|no
	DataType          DataType           `xml:"dataType"`
	DefaultValue      string             `xml:"defaultValue"`
	AllowedValueRange *AllowedValueRange `xml:"allowedValueRange"`
	AllowedValues     []string           `xml:"allowedValueList>allowedValue"`
}

StateVariable XML data.

func (*StateVariable) Clean

func (v *StateVariable) Clean()

Clean removes stray whitespace in the structure.

Jump to

Keyboard shortcuts

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