Documentation ¶
Overview ¶
Monitron Dashboard, terminal based dashboard for the Monitron CI dashboard
Index ¶
Constants ¶
const ( BuildStateFailed buildState = iota BuildStateAcknowledged BuildStatePassed BuildStateUnknown )
const OrangeColour int = 167
Variables ¶
This section is empty.
Functions ¶
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.
type Layout ¶
type Layout struct {
// contains filtered or unexported fields
}
Layout struct containing a slice of rectangles for each grid position.
type RuneWriter ¶
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 ¶
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)