ssdp

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: 18 Imported by: 0

Documentation

Overview

Package ssdp implements an SSDP (=Simple Service Discovery Protocol) server

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssetID

type AssetID struct{ NT, USN string }

AssetID contains the NT and USN fields of devices and services

type DiscoveryData

type DiscoveryData struct {
	Location string
	AssIDs   []AssetID
	Server   string
	MaxAge   int
}

DiscoveryData contains the data from a device tree that is required for alive or byebye notifications

func (*DiscoveryData) String

func (me *DiscoveryData) String() (s string)

String returns a string representation of DiscoveryData

type SearchIndex

type SearchIndex map[string]([]*desc.Device)

SearchIndex maps keys like service and device types to the devices that implement these types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server represents an SSDP server. Such a server is created per network interface. If multiple interfaces are available, one SSDP server is created per interface

func New

func New(data DiscoveryData, index SearchIndex, bootID func() *types.BootID, configID func() *types.ConfigID, inf net.Interface, port int) (srv *Server, err error)

New creates a new SSDP server

func (*Server) Connect

func (me *Server) Connect() (err error)

Connect connects the SSDP server (i.e. starts the notification and search response processes)

func (*Server) Disconnect

func (me *Server) Disconnect(wg *sync.WaitGroup)

Disconnect disconnect the SSDP server (i.e. stops the notification and search response processes)

Jump to

Keyboard shortcuts

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