ssdp

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMalformedRequest = errors.New("malformed SSDP request")
)

Functions

func NotifyDeviceAvailable

func NotifyDeviceAvailable(device upnp.Device) (err error)

NotifyDeviceAvailable broadcasts a device available advertisement on all networks.

func NotifyDeviceUnavailable

func NotifyDeviceUnavailable(device upnp.Device) (err error)

NotifyDeviceAvailable broadcasts a device unavailable advertisement on all networks.

Types

type Request

type Request struct {
	// Request method
	Method string
	// contains filtered or unexported fields
}

SSDP request

func (*Request) GetHeader

func (req *Request) GetHeader(name string) string

func (*Request) SetHeader

func (req *Request) SetHeader(name, value string)

func (*Request) Unmarshal

func (req *Request) Unmarshal(b []byte) (err error)

func (*Request) WriteTo

func (req *Request) WriteTo(w io.Writer) (n int64, err error)

type Response

type Response struct {
	// Response status
	StatusCode int
	// contains filtered or unexported fields
}

SSDP response

func (*Response) SetHeader

func (r *Response) SetHeader(name, value string)

func (*Response) WriteTo

func (r *Response) WriteTo(w io.Writer) (n int64, err error)

type Server

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

Server is a simple SSDP server implementation.

func NewServer

func NewServer(device upnp.Device) *Server

func (*Server) Done

func (s *Server) Done() <-chan struct{}

func (*Server) Shutdown

func (s *Server) Shutdown()

func (*Server) Startup

func (s *Server) Startup() (err error)

Jump to

Keyboard shortcuts

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