Documentation ¶
Overview ¶
Package controller runs Probes, reads time, receives Statuses from Probes, Command from the UI, and computes a View for the app to display.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command uint8
A Command is used to change the View generated by the controller, by filtering, sorting, or changing display formats.
const ( // CmdQuit is the command to quit the app CmdQuit Command = 0 // CmdFilterSeverityAll is the command to display all Statuses regardless of their Severity CmdFilterSeverityAll Command = iota // CmdFilterSeverityNotice is the command to display all Statuses with Severity notice or worse CmdFilterSeverityNotice Command = iota // CmdFilterSeverityWarning is the command to display all Statuses with Severity warning or worse CmdFilterSeverityWarning Command = iota // CmdFilterSeverityCritical is the command to display all Statuses with Severity critical CmdFilterSeverityCritical Command = iota // CmdFilterLayerAll show all statuses regardless of layer, provided that they match the severity filter in effect. CmdFilterLayerAll Command = iota // CmdFilterLayerInfrastructure show infrastructure layer statuses, provided that they match the severity filter in effect. CmdFilterLayerInfrastructure Command = iota // CmdFilterLayerPlatform show all statuses regardless of layer, provided that they match the severity filter in effect. CmdFilterLayerPlatform Command = iota // CmdFilterLayerApplication show all statuses regardless of layer, provided that they match the severity filter in effect. CmdFilterLayerApplication Command = iota // CmdSortLastChange is the command to display Statuses from most recent change to oldest or unknown change time CmdSortLastChange Command = iota // CmdSortSeverity is the command to display Statuses from worse Severity to best Severity. CmdSortSeverity Command = iota // CmdSortLabel is the command to display Statuses by alphabetical Label. CmdSortLabel Command = iota // CmdSortLayer display Statuses by layer, starting from topmost applications and descending into infrastructure CmdSortLayer Command = iota // CmdDurationFormat switches between displaying time or duration for Update and Change columns. CmdDurationFormat Command = iota // CmdClockChoice switches between different clocks with different formats or locations. CmdClockChoice Command = iota )
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
A Controller tracks the state of the application and outputs a View for the app to display.
func NewController ¶
func NewController( cfg *configuration.ControllerConfig, prc []configuration.ProbeRunnerConfig, cmds <-chan Command, v chan<- View, quitter Quitter, ) *Controller
NewController creates a usable controller from configuration and channel spaghettis.
func (*Controller) Run ¶
func (c *Controller) Run(ctx context.Context)
Run starts the controller, which will run until the provided context is done.
type Quitter ¶
type Quitter func()
Quitter is the function to call in order to quit the app gracefully.
type Row ¶
type Row struct { ID string // not displayed, from probe Severity model.Severity // min(from probe, from configuration) Layer model.Layer // from configuration || from probe Label string // from configuration Description string // from probe Update string // from probe Change string // from probe UpdateSec int ChangeSec int }
A Row is to be displayed in a table and is a UI representation of a Status.