Documentation ¶
Overview ¶
Package web provides an HTTP server for the dashboard application
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Getenv ¶
Getenv returns the value of the env var with the given name, or fallback to the given default value.
func RunHttpServer ¶
func RunHttpServer()
RunHttpServer runs an HTTP server on a port defined by the PORT env var (default to 8080)
Types ¶
type Context ¶
Context is a web context used to answer to requests.
func (*Context) HomeHandler ¶
func (c *Context) HomeHandler(w http.ResponseWriter, req *http.Request, _ httprouter.Params)
HomeHandler answers HTTP requests by loading data for all resource types and using the "home" view
func (*Context) StatsHandler ¶
func (c *Context) StatsHandler(w http.ResponseWriter, req *http.Request, _ httprouter.Params)
StatsHandler answers HTTP requests with the stats in JSON format
Click to show internal directories.
Click to hide internal directories.