Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultSegments = []*Segment{ {Bucket: 3125, Rectangle: image.Rect(5, 1, 5, 5), Color: color.RandomPlan9PaletteColor()}, {Bucket: 625, Rectangle: image.Rect(4, 1, 4, 5), Color: color.RandomPlan9PaletteColor()}, {Bucket: 125, Rectangle: image.Rect(3, 1, 3, 5), Color: color.RandomPlan9PaletteColor()}, {Bucket: 25, Rectangle: image.Rect(2, 1, 2, 5), Color: color.RandomPlan9PaletteColor()}, {Bucket: 5, Rectangle: image.Rect(1, 1, 1, 5), Color: color.RandomPlan9PaletteColor()}, {Bucket: 1, Rectangle: image.Rect(0, 1, 0, 5), Color: color.RandomPlan9PaletteColor()}, }
DefaultSegments provides a default set of segments.
Functions ¶
func SignalHandler ¶
SignalHandler blocks, waiting for a signal from the system, before clearing the screen.
Types ¶
type Counter ¶
type Counter struct { Segments []*Segment // contains filtered or unexported fields }
Counter represents the section of the display that shows the current pin count.
func NewCounter ¶
NewCounter contructs a Counter.
func (*Counter) DrawPinCount ¶
DrawPinCount draws a pixel a color everytime that peer gets a new metric. Also, does a flashy animation indicating whether a pin or unpin occurred.
type Direction ¶
type Direction int
Direction is the direction that an animation should go across the screen.
type Segment ¶
type Segment struct { Bucket int image.Rectangle Color color.Pixel565 // contains filtered or unexported fields }
Segment represents a column segment of the counter.
type Statuses ¶
Statuses represents the section of the display that shows the status of the other peers in the cluster.
func NewStatuses ¶
NewStatuses constructs a Statuses type with a Cluster client.
func (*Statuses) AddNewPeer ¶
AddNewPeer adds a newly found peer to the Statuses Peers slice and assigns it a new position. Returns false if there is no more room in the slice.
func (*Statuses) DrawPeerStatuses ¶
DrawPeerStatuses draws a pixel a color everytime that peer gets a new metric.
func (*Statuses) DropExpiredPeer ¶
DropExpiredPeer removes a peer from the Statuses Peers slice.