dashing

package module
v0.0.0-...-c9a6fae Latest Latest
Warning

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

Go to latest
Published: May 28, 2014 License: MIT Imports: 10 Imported by: 0

README

dashing-go

A Go port of shopify/dashing, built upon Martini.

To generate a dashboard using this library, please use the Yeoman dashing-go generator.

For a live demo, here's the default sample dashboard.

Current Status
  • All endpoints have been ported over! Full functionality is available.
  • For an example of how to write jobs in dashing-go, please refer to the demo dashboard source.

Credits

Much of the code is referenced from golang-sse-todo by @rwynn.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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.

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 {
	ID     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