dashboard

package
v0.0.0-...-38a89e1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2015 License: MIT Imports: 9 Imported by: 2

Documentation

Overview

Package dashboard provides a web portal to see the status of the system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server is a server that presents the dashboard.

func New

func New(conf *config.Configuration, counter *hitcounter.HitCounter) *Server

New returns an initialized instance of *Server.

func (*Server) HandleAssets

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

HandleAssets serves the HTML, CSS and JS assets for the dashboard.

func (*Server) HandleHistory

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

HandleHistory returns an object in JSON with the following members.

  • "Clock": {number} is the current clock value (starting from 0).

  • "TotalHits": {number} is the total number of hits in the past 24 hours.

  • "Directions": {array} is the collection of directions. Each item is an object with the following members:

  • "blocked-values": {array} is the collection of blocked values.

  • "name": {string} is the name of the direction.

func (*Server) ListenAndServe

func (s *Server) ListenAndServe()

ListenAndServe blocks and listens for requests.

Jump to

Keyboard shortcuts

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