webserver

package
v0.0.0-...-681265f Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateStaticPages

func GenerateStaticPages()

GenerateStaticPages writes files 404.html, about.html, etc.

func InitTemplates

func InitTemplates()

InitTemplates initializes page templates from the included files

func Serve

func Serve()

Serve starts the web server and blocks.

func ServeRootPage

func ServeRootPage(w http.ResponseWriter, r *http.Request)

ServeRootPage serves a page listing all filters.

func ServeStreamRequest

func ServeStreamRequest(w http.ResponseWriter, r *http.Request)

ServeStreamRequest serves a series of <a><img></a> tags for thumbs of a specified stream.

func Write404Page

func Write404Page(w io.Writer)

Write404Page writes the 404 page.

func WriteAboutPage

func WriteAboutPage(w io.Writer)

WriteAboutPage writes the about page.

func WriteFilterPage

func WriteFilterPage(w io.Writer, wpd WebpageData)

Types

type BasicResponseData

type BasicResponseData struct {
	AppBaseUrl string
}

type ByViewers

type ByViewers []StreamPanel

ByViewers implements sort.Interface

func (ByViewers) Len

func (t ByViewers) Len() int

func (ByViewers) Less

func (t ByViewers) Less(i, j int) bool

func (ByViewers) Swap

func (t ByViewers) Swap(i, j int)

type FastCGIServer

type FastCGIServer struct{}

func (FastCGIServer) ServeHTTP

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

ServeHTTP computes responses for HTTP requests passed to the app.

type PanelGroup

type PanelGroup struct {
	StreamPanels []StreamPanel
	Title        string
}

type StreamPanel

type StreamPanel struct {
	StreamID           uint
	ChannelDisplayName string
	ChannelName        string
	CoverImages        []string
	Title              string
	Live               bool
	Viewers            int
	Length             string
	OriginalIndex      int
	FilterTop10        bool
}

func PanelOfStream

func PanelOfStream(stream database.Stream, index int) StreamPanel

PanelOfStream generates a StreamPanel based on a stream

type StreamResponseClip

type StreamResponseClip struct {
	ClipUrl  string
	ImageUrl string
}

type StreamResponseData

type StreamResponseData struct {
	Length string
	Thumbs []StreamResponseThumb
	Clips  []StreamResponseClip
}

type StreamResponseThumb

type StreamResponseThumb struct {
	LinkUrl  string
	ImageUrl string
	HasVOD   bool
}

type Times

type Times []time.Time

Times implements sort.Interface

func (Times) Len

func (t Times) Len() int

func (Times) Less

func (t Times) Less(i, j int) bool

func (Times) Swap

func (t Times) Swap(i, j int)

type WebpageData

type WebpageData struct {
	Title       string
	AppBaseUrl  string
	PanelGroups []PanelGroup
}

func FilterPageData

func FilterPageData(f database.Filter) WebpageData

FilterPageData generates a struct listing all streams of a filter.

Jump to

Keyboard shortcuts

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