Documentation ¶
Index ¶
- Constants
- Variables
- func BenchConfig(cluster string) string
- func ComputeMaxColumns(pads MaxyPad, sortCol int, table resource.TableData)
- func DefaultColorer(ns string, r *resource.RowEvent) tcell.Color
- func Deltas(o, n string) string
- func IsASCII(s string) bool
- func Pad(s string, width int) string
- func TrimCell(tv *Table, row, col int) string
- type ActionHandler
- type ActionsFunc
- type App
- func (a *App) ActivateCmd(b bool)
- func (a *App) ActiveView() Igniter
- func (a *App) AddActions(aa KeyActions)
- func (a *App) BailOut()
- func (a *App) Cmd() *CmdView
- func (a *App) Conn() k8s.Connection
- func (a *App) Crumbs() *CrumbsView
- func (a *App) Flash() *FlashView
- func (a *App) Frame() *tview.Pages
- func (a *App) GetActions() KeyActions
- func (a *App) GetCmd() string
- func (a *App) GetCmdBuff() *CmdBuff
- func (a *App) GetHints() Hints
- func (a *App) HasCmd() bool
- func (a *App) InCmdMode() bool
- func (a *App) Init()
- func (a *App) Logo() *LogoView
- func (a *App) Main() *tview.Pages
- func (a *App) Menu() *MenuView
- func (a *App) ResetCmd()
- func (a *App) SetHints(h Hints)
- func (a *App) StatusReset()
- func (a *App) Views() map[string]tview.Primitive
- type CmdBuff
- func (c *CmdBuff) Add(r rune)
- func (c *CmdBuff) AddListener(w ...buffWatcher)
- func (c *CmdBuff) Clear()
- func (c *CmdBuff) Delete()
- func (c *CmdBuff) Empty() bool
- func (c *CmdBuff) IsActive() bool
- func (c *CmdBuff) Reset()
- func (c *CmdBuff) Set(rr []rune)
- func (c *CmdBuff) SetActive(b bool)
- func (c *CmdBuff) String() string
- type CmdStack
- type CmdView
- type ColorerFunc
- type Configurator
- type CrumbsView
- type FlashLevel
- type FlashView
- type GroupSorter
- type Hint
- type Hinter
- type Hints
- type Igniter
- type IndicatorView
- type KeyAction
- type KeyActions
- type LogoView
- type MaxyPad
- type MenuView
- type RowSorter
- type SelectedRowFunc
- type SortColumn
- type SortFn
- type SplashView
- type Table
- func (v *Table) ActiveNS() string
- func (v *Table) AddHeaderCell(numerical bool, col int, name string)
- func (v *Table) AddSelectedRowListener(f SelectedRowFunc)
- func (v *Table) ClearSelection()
- func (v *Table) Cmd() *CmdBuff
- func (v *Table) GetBaseTitle() string
- func (v *Table) GetData() resource.TableData
- func (v *Table) GetRow() resource.Row
- func (v *Table) GetSelectedCell(col int) string
- func (v *Table) GetSelectedItem() string
- func (v *Table) GetSelectedRow() int
- func (v *Table) Hints() Hints
- func (v *Table) KeyBindings() KeyActions
- func (v *Table) NameColIndex() int
- func (v *Table) Refresh()
- func (v *Table) RmAction(kk ...tcell.Key)
- func (v *Table) RowSelected() bool
- func (v *Table) SelectFirstRow()
- func (v *Table) SelectRow(r int, broadcast bool)
- func (v *Table) SetActions(aa KeyActions)
- func (v *Table) SetActiveNS(ns string)
- func (v *Table) SetBaseTitle(s string)
- func (v *Table) SetColorerFn(f ColorerFunc)
- func (v *Table) SetSelectedFn(f func(string) string)
- func (v *Table) SetSortCol(index, count int, asc bool)
- func (v *Table) ShowDeleted()
- func (v *Table) SortColCmd(col int) func(evt *tcell.EventKey) *tcell.EventKey
- func (v *Table) SortInvertCmd(evt *tcell.EventKey) *tcell.EventKey
- func (v *Table) Update(data resource.TableData)
- func (v *Table) UpdateTitle()
Constants ¶
const ( // DeltaSign signals a diff. DeltaSign = "Δ" // PlusSign signals inc. PlusSign = "↑" // MinusSign signal dec. MinusSign = "↓" )
const ( Key0 int32 = iota + 48 Key1 Key2 Key3 Key4 Key5 Key6 Key7 Key8 Key9 )
Defines numeric keys for container actions
const ( KeyA tcell.Key = iota + 97 KeyB KeyC KeyD KeyE KeyF KeyG KeyH KeyI KeyJ KeyK KeyL KeyM KeyN KeyO KeyP KeyQ KeyR KeyS KeyT KeyU KeyV KeyW KeyX KeyY KeyZ KeyHelp = 63 KeySlash = 47 KeyColon = 58 )
Defines char keystrokes
const ( KeyShiftA tcell.Key = iota + 65 KeyShiftB KeyShiftC KeyShiftD KeyShiftE KeyShiftF KeyShiftG KeyShiftH KeyShiftI KeyShiftJ KeyShiftK KeyShiftL KeyShiftM KeyShiftN KeyShiftO KeyShiftP KeyShiftQ KeyShiftR KeyShiftS KeyShiftT KeyShiftU KeyShiftV KeyShiftW KeyShiftX KeyShiftY KeyShiftZ )
Define Shift Keys
Variables ¶
var ( // ModColor row modified color. ModColor tcell.Color // AddColor row added color. AddColor tcell.Color // ErrColor row err color. ErrColor tcell.Color // StdColor row default color. StdColor tcell.Color // HighlightColor row highlight color. HighlightColor tcell.Color // KillColor row deleted color. KillColor tcell.Color // CompletedColor row completed color. CompletedColor tcell.Color )
var Logo = []string{
` ____ __.________ _________ .____ .___ `,
`| |/ _/ __ \_____\_ ___ \| | | |`,
`| < \____ / ___/ \ \/| | | |`,
`| | \ / /\___ \\ \___| |___| |`,
`|____|__ \ /____//____ >\______ /_______ \___|`,
` \/ \/ \/ \/ `,
}
Logo K9s big logo for splash page.
var LogoSmall = []string{
` ____ __.________ `,
`| |/ _/ __ \______`,
`| < \____ / ___/`,
`| | \ / /\___ \ `,
`|____|__ \ /____//____ >`,
` \/ \/ `,
}
LogoSmall K9s small log.
var NumKeys = map[int]int32{ 0: Key0, 1: Key1, 2: Key2, 3: Key3, 4: Key4, 5: Key5, 6: Key6, 7: Key7, 8: Key8, 9: Key9, }
NumKeys tracks number keys.
Functions ¶
func BenchConfig ¶
BenchConfig location of the benchmarks configuration file.
func ComputeMaxColumns ¶
ComputeMaxColumns figures out column max size and necessary padding.
func DefaultColorer ¶
DefaultColorer set the default table row colors.
Types ¶
type ActionHandler ¶
ActionHandler handles a keyboard command.
type App ¶
type App struct { *tview.Application Configurator // contains filtered or unexported fields }
App represents an application.
func (*App) ActiveView ¶
ActiveView returns the currently active view.
func (*App) AddActions ¶
func (a *App) AddActions(aa KeyActions)
AddActions returns the application actions.
func (*App) GetActions ¶
func (a *App) GetActions() KeyActions
GetActions returns a collection of actions.
type CmdBuff ¶
type CmdBuff struct {
// contains filtered or unexported fields
}
CmdBuff represents user command input.
func (*CmdBuff) AddListener ¶
func (c *CmdBuff) AddListener(w ...buffWatcher)
AddListener registers a cmd buffer listener.
func (*CmdBuff) Delete ¶
func (c *CmdBuff) Delete()
Delete removes the last character from the buffer.
type CmdStack ¶
type CmdStack struct {
// contains filtered or unexported fields
}
CmdStack tracks users command breadcrumbs.
type CmdView ¶
CmdView captures users free from command input.
func NewCmdView ¶
NewCmdView returns a new command view.
type ColorerFunc ¶
ColorerFunc represents a row colorer.
type Configurator ¶
type Configurator struct { HasSkins bool Config *config.Config Styles *config.Styles Bench *config.Bench }
Configurator represents an application configurations.
func (*Configurator) InitBench ¶
func (c *Configurator) InitBench(cluster string)
InitBench load benchmark configuration if any.
func (*Configurator) RefreshStyles ¶
func (c *Configurator) RefreshStyles()
RefreshStyles load for skin configuration changes.
func (*Configurator) StylesUpdater ¶
func (c *Configurator) StylesUpdater(ctx context.Context, s synchronizer) error
StylesUpdater watches for skin file changes.
type CrumbsView ¶
CrumbsView represents user breadcrumbs.
func NewCrumbsView ¶
func NewCrumbsView(styles *config.Styles) *CrumbsView
NewCrumbsView returns a new breadcrumb view.
func (*CrumbsView) Refresh ¶
func (v *CrumbsView) Refresh(crumbs []string)
Refresh updates view with new crumbs.
type FlashLevel ¶
type FlashLevel int
FlashLevel represents flash message severity.
const ( // FlashInfo represents an info message. FlashInfo FlashLevel = iota // FlashWarn represents an warning message. FlashWarn // FlashErr represents an error message. FlashErr // FlashFatal represents an fatal message. FlashFatal )
type FlashView ¶
FlashView represents a flash message indicator.
func NewFlashView ¶
func NewFlashView(app *tview.Application, m string) *FlashView
NewFlashView returns a new flash view.
type GroupSorter ¶
type GroupSorter struct {
// contains filtered or unexported fields
}
GroupSorter sorts a collection of rows.
func (GroupSorter) Len ¶
func (s GroupSorter) Len() int
func (GroupSorter) Less ¶
func (s GroupSorter) Less(i, j int) bool
func (GroupSorter) Swap ¶
func (s GroupSorter) Swap(i, j int)
type Igniter ¶
type Igniter interface { tview.Primitive // Init initializes the view. Init(ctx context.Context, ns string) }
Igniter represents an initializable view.
type IndicatorView ¶
IndicatorView represents a status indicator.
func NewIndicatorView ¶
func NewIndicatorView(app *App, styles *config.Styles) *IndicatorView
NewIndicatorView returns a new logo.
func (*IndicatorView) Info ¶
func (v *IndicatorView) Info(msg string)
Info displays a log info state.
func (*IndicatorView) Reset ¶
func (v *IndicatorView) Reset()
Reset clears out the logo view and resets colors.
func (*IndicatorView) SetPermanent ¶
func (v *IndicatorView) SetPermanent(info string)
SetPermanent sets permanent title to be reset to after updates
func (*IndicatorView) Warn ¶
func (v *IndicatorView) Warn(msg string)
Warn displays a log warning state.
type KeyAction ¶
type KeyAction struct { Description string Action ActionHandler Visible bool }
KeyAction represents a keyboard action.
func NewKeyAction ¶
func NewKeyAction(d string, a ActionHandler, display bool) KeyAction
NewKeyAction returns a new keyboard action.
type KeyActions ¶
KeyActions tracks mappings between keystrokes and actions.
type LogoView ¶
LogoView represents a K9s logo.
func NewLogoView ¶
NewLogoView returns a new logo.
type MenuView ¶
MenuView represents menu options.
func NewMenuView ¶
NewMenuView returns a new menu.
func (*MenuView) HydrateMenu ¶
HydrateMenu populate menu ui from hints.
type RowSorter ¶
type RowSorter struct {
// contains filtered or unexported fields
}
RowSorter sorts rows.
type SelectedRowFunc ¶
type SelectedRowFunc func(r, c int)
SelectedRowFunc a table selection callback.
type SortColumn ¶
type SortColumn struct {
// contains filtered or unexported fields
}
SortColumn represents a sortable column.
type SortFn ¶
type SortFn func(rows resource.Rows, sortCol SortColumn)
SortFn represent a function that can sort columnar data.
type SplashView ¶
SplashView represents a splash screen.
type Table ¶
Table represents tabular data.
func (*Table) AddHeaderCell ¶
AddHeaderCell configures a table cell header.
func (*Table) AddSelectedRowListener ¶
func (v *Table) AddSelectedRowListener(f SelectedRowFunc)
AddSelectedRowListener add a new selected row listener.
func (*Table) GetBaseTitle ¶
GetBaseTitle fetch the current title.
func (*Table) GetSelectedCell ¶
GetSelectedCell returns the contant of a cell for the currently selected row.
func (*Table) GetSelectedItem ¶
GetSelectedItem returns the currently selected item name.
func (*Table) GetSelectedRow ¶
GetSelectedRow fetch the currently selected row index.
func (*Table) KeyBindings ¶
func (v *Table) KeyBindings() KeyActions
KeyBindings returns the bounded keys.
func (*Table) NameColIndex ¶
NameColIndex returns the index of the resource name column.
func (*Table) RowSelected ¶
RowSelected checks if there is an active row selection.
func (*Table) SelectFirstRow ¶
func (v *Table) SelectFirstRow()
SelectFirstRow select first data row if any.
func (*Table) SetActions ¶
func (v *Table) SetActions(aa KeyActions)
SetActions sets up keyboard action listener.
func (*Table) SetActiveNS ¶
SetActiveNS set the resource namespace.
func (*Table) SetBaseTitle ¶
SetBaseTitle set the table title.
func (*Table) SetColorerFn ¶
func (v *Table) SetColorerFn(f ColorerFunc)
SetColorerFn set the row colorer.
func (*Table) SetSelectedFn ¶
SetSelectedFn defines a function that cleanse the current selection.
func (*Table) SetSortCol ¶
SetSortCol sets in sort column index and order.
func (*Table) SortColCmd ¶
SortColCmd designates a sorted column.
func (*Table) SortInvertCmd ¶
SortInvertCmd reverses sorting order.