httphandlers

package
v0.16.4 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPserver

type HTTPserver struct {
	Mux *http.ServeMux
	// contains filtered or unexported fields
}

HTTPserver - new http.Server instance.

func NewServer

func NewServer(a string) *HTTPserver

NewServer constractor generates a new HTTPserver type.

func (*HTTPserver) AddHandler

func (s *HTTPserver) AddHandler(path string, payload *soapcalls.TVPayload, media interface{})

AddHandler dynamically adds a new handler. Currenly used by the gapless playback logic where we use the same server to serve multiple media files.

func (*HTTPserver) RemoveHandler

func (s *HTTPserver) RemoveHandler(path string)

RemoveHandler dynamically removes a handler.

func (*HTTPserver) ServeMediaHandler

func (s *HTTPserver) ServeMediaHandler() http.HandlerFunc

ServeMediaHandler is a helper method used to properly handle media and subtitle streaming.

func (*HTTPserver) StartServer

func (s *HTTPserver) StartServer(serverStarted chan<- error, media, subtitles interface{},
	tvpayload *soapcalls.TVPayload, screen Screen,
)

StartServer will start a HTTP server to serve the selected media files and also handle the subscriptions requests from the DMR devices.

func (*HTTPserver) StopServer

func (s *HTTPserver) StopServer()

StopServer forcefully closes the HTTP server.

type Screen

type Screen interface {
	EmitMsg(string)
	Fini()
}

Screen interface is used to push message back to the user as these are returned by the subscriptions.

Jump to

Keyboard shortcuts

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