plumbing

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2021 License: BSD-3-Clause Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

A Server wraps a HTTP frontend

func New

func New(config ServerConfig) (*Server, error)

New instantiates a new server instance

func (*Server) Close

func (s *Server) Close() error

Close frees any held resources

func (*Server) HTMLFunc

func (s *Server) HTMLFunc(handler web.Handler, templateName string) http.Handler

HTMLFunc creates a HTTP handler that outputs HTML

func (*Server) JSONFunc

func (s *Server) JSONFunc(handler web.Handler) http.Handler

JSONFunc creates a HTTP handler that outputs JSON

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ServerConfig

type ServerConfig struct {
	Context      context.Context
	Library      *speeldoos.Library
	StreamConfig chunker.MP3ChunkConfig
}

A ServerConfig combines common options for running a HTTP frontend

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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