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 ¶
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.