server

package
v0.0.0-...-61862c7 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Listen

func Listen(addr string) (listener net.Listener, err error)

Listen listens on the server port.

func ServeMessage

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

func ServeQRCode

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

func Start

func Start(listener net.Listener)

Start creates a new server

Types

type LogServer

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

func NewLogServer

func NewLogServer(withDate bool) (ls *LogServer)

func (*LogServer) OnLogLine

func (ls *LogServer) OnLogLine(s string)

func (*LogServer) ServeHTTP

func (ls *LogServer) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*LogServer) ServeLogWS

func (ls *LogServer) ServeLogWS(w http.ResponseWriter, r *http.Request)

type ManualTrigger

type ManualTrigger struct {
	Type    definition.EventType
	Station string
	Name    string
}

type Monitor

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

func NewMonitor

func NewMonitor(def *definition.Definition, st *state.State, mtch chan<- ManualTrigger) (m *Monitor)

NewMonitor creates a new sub-server for rendering monitor pages. mtch is the channel onto which the server should write any manual triggers invoked by the user.

func (*Monitor) OnEventChange

func (m *Monitor) OnEventChange(e *state.Event)

OnEventChange receives notification of a new or updated event, and uses it to update the monitor.

func (*Monitor) ServeHTTP

func (m *Monitor) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP serves the page HTML.

func (*Monitor) ServeWS

func (m *Monitor) ServeWS(w http.ResponseWriter, r *http.Request)

ServeWS accepts and serves the websocket connection from the page.

Jump to

Keyboard shortcuts

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