Documentation ¶
Index ¶
- func Register(j Job)
- type Broker
- type Dashing
- type Event
- type Job
- type Server
- func (s *Server) DashboardEventHandler(w http.ResponseWriter, r *http.Request)
- func (s *Server) DashboardHandler(w http.ResponseWriter, r *http.Request)
- func (s *Server) EventsHandler(w http.ResponseWriter, r *http.Request)
- func (s *Server) IndexHandler(w http.ResponseWriter, r *http.Request)
- func (s *Server) NewRouter() http.Handler
- func (s *Server) WidgetEventHandler(w http.ResponseWriter, r *http.Request)
- func (s *Server) WidgetHandler(w http.ResponseWriter, r *http.Request)
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Broker ¶
type Broker struct {
// contains filtered or unexported fields
}
A Broker broadcasts events to multiple clients.
type Dashing ¶
type Dashing struct { Broker *Broker Worker *Worker Server *Server Router http.Handler // contains filtered or unexported fields }
Dashing struct definition.
func NewDashing ¶
func NewDashing() *Dashing
NewDashing sets up the event broker, workers and webservice.
type Event ¶
An Event contains the widget ID, a body of data, and an optional target (only "dashboard" for now).
type Job ¶
type Job interface {
Work(send chan *Event)
}
A Job does periodic work and sends events to a channel.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
A Server contains webservice parameters and middlewares.
func (*Server) DashboardEventHandler ¶
func (s *Server) DashboardEventHandler(w http.ResponseWriter, r *http.Request)
DashboardEventHandler accepts dashboard events.
func (*Server) DashboardHandler ¶
func (s *Server) DashboardHandler(w http.ResponseWriter, r *http.Request)
DashboardHandler serves the dashboard layout template.
func (*Server) EventsHandler ¶
func (s *Server) EventsHandler(w http.ResponseWriter, r *http.Request)
EventsHandler opens a keepalive connection and pushes events to the client.
func (*Server) IndexHandler ¶
func (s *Server) IndexHandler(w http.ResponseWriter, r *http.Request)
IndexHandler redirects to the default dashboard.
func (*Server) WidgetEventHandler ¶
func (s *Server) WidgetEventHandler(w http.ResponseWriter, r *http.Request)
WidgetEventHandler accepts widget data.
func (*Server) WidgetHandler ¶
func (s *Server) WidgetHandler(w http.ResponseWriter, r *http.Request)
WidgetHandler serves widget templates.