monitrondashboard

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

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

Go to latest
Published: May 6, 2015 License: MIT Imports: 7 Imported by: 0

README

Monitron Dashboard

A Dashboard for the Monitron build server, using only the terminal for presentation; written using the excellent Termbox.

Build Status

Getting Started

We assume you have a working go environment, obtainable here: http://golang.org/.

  • go get github.com/samuelrayment/monitrondashboard
  • go install github.com/samuelrayment/monitrondashboard

You can now run the dashboard using:

monidash -a <hostname:port for your monitron server>

You can also provide the address using an environment variable:

MD_ADDRESS

Docker

You can run the monitron dashboard from a docker image, you must use a tty and interactive mode though adjusting the MD_ADDRESS to the correct monitron server address, e.g.:

sudo docker run -ti --rm --name monidash -e MD_ADDRESS=192.168.0.13:9988 bestriped/monitrondashboard

Documentation

Overview

Monitron Dashboard, terminal based dashboard for the Monitron CI dashboard

Index

Constants

View Source
const (
	BuildStateFailed buildState = iota
	BuildStateAcknowledged
	BuildStatePassed
	BuildStateUnknown
)
View Source
const OrangeColour int = 167

Variables

This section is empty.

Functions

func NewRect

func NewRect(x, y, w, h int) rect

Types

type AttributeWriter

type AttributeWriter func(fg, bg termbox.Attribute, point point) (termbox.Attribute, termbox.Attribute)

AttributeWriter is a function that returns the attributes that should be applied to a particular cell.

type BuildFetcher

type BuildFetcher interface {
	BuildChannel() chan BuildUpdate
}

A BuildFetcher is an interface that exposes a BuildChannel which can be used to receive all BuildUpdates

func NewBuildFetcher

func NewBuildFetcher(address string) BuildFetcher

type BuildUpdate

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

type CellDrawer

type CellDrawer interface {
	// SetCell draws rune ch at x, y with foreground and background attributes.
	SetCell(x, y int, ch rune, fg, bg termbox.Attribute)
	Flush()
}

CellDrawer is an interface for drawing Cells on the screen, we use this wrap the termbox module level api to something a little more testable.

type Dashboard

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

Dashboard interface that can draw to any CellDrawer interface.

func NewDashboard

func NewDashboard(fetcher BuildFetcher, cellDrawer CellDrawer) Dashboard

NewDashboard creates a new Dashboard using the provided CellDrawer to draw to the screen.

func (*Dashboard) Run

func (d *Dashboard) Run()

run runs the dashboard event loop, redrawing the screen; responding to input events and updating based on new build information

type Layout

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

Layout struct containing a slice of rectangles for each grid position.

type RuneWriter

type RuneWriter func(char rune, point point) rune

RuneWriter is a function that returns the rune that should be drawn at point, the current rune `char` is passed into the RuneWriter so it can return that if this writer doesn't want to draw a rune, allowing for chaining of writers

type StringUntilReader

type StringUntilReader interface {
	ReadString(delim byte) (line string, err error)
}

StringUntilReader provides the ReadString method from bufio.Reader

type TermboxCellDrawer

type TermboxCellDrawer struct{}

TermboxCellDrawer implements CellDrawer using termbox to draw on the terminal screen.

func (TermboxCellDrawer) Flush

func (t TermboxCellDrawer) Flush()

func (TermboxCellDrawer) SetCell

func (t TermboxCellDrawer) SetCell(x, y int, ch rune, fg, bg termbox.Attribute)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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