ssdp

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// All is a search type to search all services and devices.
	All = "ssdp:all"

	// RootDevice is a search type to search UPnP root devices.
	RootDevice = "upnp:rootdevice"
)

Variables

View Source
var Interfaces []net.Interface

Interfaces specify target interfaces to multicast. If no interfaces are specified, all interfaces will be used.

Functions

func SetMulticastRecvAddrIPv4

func SetMulticastRecvAddrIPv4(addr string) error

SetMulticastRecvAddrIPv4 updates multicast address where to receive packets. This never fail now.

func SetMulticastSendAddrIPv4

func SetMulticastSendAddrIPv4(addr string) error

SetMulticastSendAddrIPv4 updates a UDP address to send multicast packets. This never fail now.

Types

type Service

type Service struct {
	// Type is a property of "ST"
	Type string

	// USN is a property of "USN"
	USN string

	// Location is a property of "LOCATION"
	Location string

	// Server is a property of "SERVER"
	Server string
	// contains filtered or unexported fields
}

Service is discovered service.

func Search(searchType string, waitSec int, localAddr string) ([]Service, error)

Search searches services by SSDP.

func (*Service) Header

func (s *Service) Header() http.Header

Header returns all properties in response of search.

func (*Service) MaxAge

func (s *Service) MaxAge() int

MaxAge extracts "max-age" value from "CACHE-CONTROL" property.

Jump to

Keyboard shortcuts

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