Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckList ¶
type CheckList struct {
// contains filtered or unexported fields
}
CheckList holds the state of a check list
func NewCheckList ¶
func NewCheckList(w io.Writer, headers ListItemInfo, items []Checker, opts *CheckListOptions) *CheckList
NewCheckList creates a new checklist
type CheckListOptions ¶
type CheckListOptions struct { // Interval to refresh the checklist default is 500ms Interval time.Duration // StateIconMap the icon to display for each item state StateIconMap map[ListItemState]string // NoColor if true will not use colors at all NoColor bool // Fullscreen if true will clear all screen each refresh Fullscreen bool // ClearAfter if true will clear the check list from the // screen after all the checks are done ClearAfter bool // WaitAllReady if true will not stop the checklist until // all items are in ready state instead of waiting for // ready or error state WaitAllReady bool }
CheckListOptions options to create a new check list
type Checker ¶
type Checker func(ctx context.Context) (ListItemState, ListItemInfo)
Checker a function used to check the current state and info of a single list item
type ListItemInfo ¶
type ListItemInfo []string
ListItemInfo holds the values for all the table columns for a single list item
type ListItemState ¶
type ListItemState string
ListItemState holds the state of a list item
const ( // Waiting for the item to be ready Waiting ListItemState = "Waiting" // Ready item is ready Ready ListItemState = "Ready" // Error item checker returns some error Error ListItemState = "Error" )
Item states
Source Files ¶
Click to show internal directories.
Click to hide internal directories.