upnp

package
v0.0.0-...-18cf193 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectAll

func CollectAll(URL string, username string, password string, resultFile string)

CollectAll available upnp metrics

Types

type Action

type Action struct {
	Name        string      `xml:"name"`
	Arguments   []*Argument `xml:"argumentList>argument"`
	ArgumentMap map[string]*Argument
	// contains filtered or unexported fields
}

Action struct

func (*Action) IsGetOnly

func (action *Action) IsGetOnly() bool

IsGetOnly Returns if the action seems to be a query for information. This is determined by checking if the action has no input arguments and at least one output argument.

type ActionArgument

type ActionArgument struct {
	Name  string
	Value interface{}
}

ActionArgument struct

type Argument

type Argument struct {
	Name                 string `xml:"name"`
	Direction            string `xml:"direction"`
	RelatedStateVariable string `xml:"relatedStateVariable"`
	StateVariable        *StateVariable
}

Argument struct

type Device

type Device struct {
	Services         []*Service `xml:"serviceList>service"`
	SubDevices       []*Device  `xml:"deviceList>device"`
	DeviceType       string     `xml:"deviceType"`
	FriendlyName     string     `xml:"friendlyName"`
	Manufacturer     string     `xml:"manufacturer"`
	ManufacturerURL  string     `xml:"manufacturerURL"`
	ModelDescription string     `xml:"modelDescription"`
	ModelName        string     `xml:"modelName"`
	ModelNumber      string     `xml:"modelNumber"`
	ModelURL         string     `xml:"modelURL"`
	UDN              string     `xml:"UDN"`
	PresentationURL  string     `xml:"presentationURL"`
}

Device struct

type Exporter

type Exporter struct {
	BaseURL    string
	Username   string
	Password   string
	Device     Device `xml:"device"`
	Services   map[string]*Service
	AuthHeader string
}

Exporter struct

func (*Exporter) Collect

func (exporter *Exporter) Collect(metrics []*metric.Metric) error

Collect func

func (*Exporter) LoadServices

func (exporter *Exporter) LoadServices() error

LoadServices loads the services tree from device

type FaultDetail

type FaultDetail struct {
	FaultError FaultError `xml:"UPnPError"`
}

FaultDetail struct

type FaultError

type FaultError struct {
	ErrorCode        int    `xml:"errorCode"`
	ErrorDescription string `xml:"errorDescription"`
}

FaultError strcut

type Service

type Service struct {
	ServiceType    string `xml:"serviceType"`
	ServiceID      string `xml:"serviceId"`
	ControlURL     string `xml:"controlURL"`
	EventSubURL    string `xml:"eventSubURL"`
	SCPDUrl        string `xml:"SCPDURL"`
	Actions        map[string]*Action
	StateVariables []*StateVariable
}

Service struct

type SoapBody

type SoapBody struct {
	XMLName xml.Name `xml:"http://schemas.xmlsoap.org/soap/envelope/ Body"`
	Fault   SoapFault
}

SoapBody struct

type SoapEnvelope

type SoapEnvelope struct {
	XMLName xml.Name `xml:"http://schemas.xmlsoap.org/soap/envelope/ Envelope"`
	Body    SoapBody
}

SoapEnvelope struct

type SoapFault

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

SoapFault struct

type StateVariable

type StateVariable struct {
	Name         string `xml:"name"`
	DataType     string `xml:"dataType"`
	DefaultValue string `xml:"defaultValue"`
}

StateVariable struct

Jump to

Keyboard shortcuts

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