dashing

package
v0.0.0-...-f7e6f76 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2015 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEvents

func GetEvents(w http.ResponseWriter, r *http.Request, e encoder.Encoder, b *Broker)

func NewServer

func NewServer(staticDirectory string) *dashingServer

func PostDashboardEvent

func PostDashboardEvent(r *http.Request, params martini.Params, b *Broker) (int, string)

func PostWidgetEvent

func PostWidgetEvent(r *http.Request, params martini.Params, b *Broker) (int, string)

func Register

func Register(j Job)

Register a job to be kicked off upon starting the server.

func Start

func Start()

Start all jobs and listen to requests.

func StartWithStaticDirectory

func StartWithStaticDirectory(staticDirectory string)

Types

type Broker

type Broker struct {
	// contains filtered or unexported fields
}

A Broker broadcasts events to multiple clients.

func NewBroker

func NewBroker() *Broker

NewBroker creates a Broker instance.

func (*Broker) Start

func (b *Broker) Start()

Start managing client connections and event broadcasts.

type Event

type Event struct {
	WidgetID string
	Body     map[string]interface{}
	Target   string
}

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.

Jump to

Keyboard shortcuts

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