dashboards

package
v0.0.0-...-a321ef9 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2016 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KBD_Q     = 1
	KBD_T     = 2
	KBD_Y     = 3
	KBD_SPACE = 4
	KBD_N     = 5
	TIME      = 6
	RESIZE    = 7
)

Keybaord consts

Variables

This section is empty.

Functions

func CommandQ

func CommandQ(inputQ <-chan interface{}, done chan bool, wg *sync.WaitGroup)

CommandQ is our main loop for processing input

func DebounceChan

func DebounceChan(input chan interface{}, wait time.Duration, res chan interface{})

DebounceChan is a simple debouncer using channels that will grab the last message after the timeout.

Types

type Column

type Column struct {
	Height int `json:"height"`
	Span   int `json:"span"`
	Offset int `json:"offset"`

	P          *P             `json:"p,omitempty"`
	TimeP      *TP.TimeP      `json:"timep,omitempty"`
	SparkLines *SL.SparkLines `json:"sparklines,omitempty"`
	BarChart   *BC.BarChart   `json:"barchart,omitempty"`
	Gauge      *G.Gauge       `json:"gauge,omitempty"`
	MultiSpark *MS.MultiSpark `json:"multispark,omitempty"`
	Loading    *LD.Loading    `json:"loading,omitempty"`
	// contains filtered or unexported fields
}

type Dashboard

type Dashboard struct {
	Rows []*Row         `json:"rows"`
	Time *TS.TimeSelect `json:"-"` //TODO: Remove this?? It's in monitor shouldn't be in 2 places

	Grid *ui.Grid `json:"-"` //json:"-" omits a field from being encoded
	// contains filtered or unexported fields
}

func NewDashboard

func NewDashboard(db DB.DBI) *Dashboard

func NewDashboardFromFile

func NewDashboardFromFile(db DB.DBI, f string) (dash *Dashboard, err error)

Dashboard get dash from path.

func (*Dashboard) Create

func (d *Dashboard) Create()

Create builds the dashboard from the json serialized structs.

func (*Dashboard) GetGrid

func (d *Dashboard) GetGrid() *ui.Grid

GetGrid returns the current grid.

func (*Dashboard) UpdateAll

func (d *Dashboard) UpdateAll(time *TS.TimeSelect)

UpdateAll updates all of our stat widgets.

type Event

type Event struct {
	Type    int
	Time    *TS.TimeSelect
	Dash    Stats
	Monitor *Monitor
}

Event are the events sent to the commandQ.

type Monitor

type Monitor struct {
	Dashes []Stats
	// contains filtered or unexported fields
}

Monitor is the main struct to monitor the dashboards.

func NewMonitor

func NewMonitor(s ...Stats) *Monitor

NewMonitor creates a new monitor struct that can display dashboards.

func (*Monitor) Close

func (m *Monitor) Close() error

Close stop's the main loop and exits the monitor.

func (*Monitor) NextDash

func (m *Monitor) NextDash()

NextDash moves to the next dashboard.

func (*Monitor) Start

func (m *Monitor) Start()

Start the monitor.

func (*Monitor) StartDash

func (m *Monitor) StartDash()

StartDash enables a dashboard, if it' hasn't been created it creates a new one.

type P

type P struct {
	Height int     `json:"height"`
	Text   string  `json:"text"`
	Par    *ui.Par `json:"-"`
	Border bool    `json:"border"`
}

type Row

type Row struct {
	Height int `json:"height"`
	Span   int `json:"span"`
	Offset int `json:"offset"`

	Columns []*Column `json:"columns"`
	// contains filtered or unexported fields
}

type Stats

type Stats interface {
	UpdateAll(*TS.TimeSelect)
	Create()
	GetGrid() *ui.Grid
}

Stats is an interface for all the widgets

Jump to

Keyboard shortcuts

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