webserver

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ForceRunHandler

type ForceRunHandler struct {
	RunQueue chan<- bool
}

ForceRunHandler implements the http.Handle interface and serves an API endpoint for forcing a new run.

func (*ForceRunHandler) ServeHTTP

func (f *ForceRunHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP handles requests for forcing a run by attempting to add to the runQueue, and writes a response including the result and a relevant message.

type StatusPageHandler

type StatusPageHandler struct {
	Template *template.Template
	Data     interface{}
	Clock    sysutil.ClockInterface
}

StatusPageHandler implements the http.Handler interface and serves a status page with info about the most recent applier run.

func (*StatusPageHandler) ServeHTTP

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

ServeHTTP populates the status page template with data and serves it when there is a request.

type WebServer

type WebServer struct {
	ListenPort     int
	Clock          sysutil.ClockInterface
	MetricsHandler http.Handler
	RunQueue       chan<- bool
	RunResults     <-chan run.Result
	Errors         chan<- error
}

func (*WebServer) Start

func (ws *WebServer) Start()

Init starts the webserver using the given port, and sets up handlers for: 1. Status page 2. Metrics 3. Static content 4. Endpoint for forcing a run

Jump to

Keyboard shortcuts

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