Documentation ¶
Index ¶
- Constants
- Variables
- func AsKey(evt *tcell.EventKey) tcell.Key
- func AsPercDelta(ov, nv int) string
- func ComputeMaxColumns(pads MaxyPad, sortColName string, t *model1.TableData)
- func Deltas(o, n string) string
- func IsASCII(s string) bool
- func Pad(s string, width int) string
- func SkinTitle(fmat string, style config.Frame) string
- func ToMnemonic(s string) string
- func TrimCell(tv *SelectTable, row, col int) string
- func TrimLabelSelector(s string) string
- func Truncate(str string, width int) string
- type ActionHandler
- type ActionOpts
- type App
- func (a *App) ActivateCmd(b bool)
- func (a *App) AddActions(aa *KeyActions)
- func (a *App) BailOut()
- func (a *App) BufferActive(state bool, kind model.BufferKind)
- func (a *App) BufferChanged(_, _ string)
- func (a *App) BufferCompleted(_, _ string)
- func (a *App) CmdBuff() *model.FishBuff
- func (a *App) Conn() client.Connection
- func (a *App) Crumbs() *Crumbs
- func (a *App) Flash() *model.Flash
- func (a *App) GetActions() *KeyActions
- func (a *App) GetCmd() string
- func (a *App) HasAction(key tcell.Key) (KeyAction, bool)
- func (a *App) HasCmd() bool
- func (a *App) InCmdMode() bool
- func (a *App) Init()
- func (a *App) IsRunning() bool
- func (a *App) Logo() *Logo
- func (a *App) Menu() *Menu
- func (a *App) Prompt() *Prompt
- func (a *App) QueueUpdate(f func())
- func (a *App) QueueUpdateDraw(f func())
- func (a *App) ResetCmd()
- func (a *App) ResetPrompt(m PromptModel)
- func (a *App) SetRunning(f bool)
- func (a *App) StylesChanged(s *config.Styles)
- func (a *App) SuggestionChanged(ss []string)
- func (a *App) Views() map[string]tview.Primitive
- type ColorerFunc
- type Configurator
- func (c *Configurator) ConfigWatcher(ctx context.Context, s synchronizer) error
- func (c *Configurator) CustomViewsWatcher(ctx context.Context, s synchronizer) error
- func (c *Configurator) HasSkin() bool
- func (c *Configurator) RefreshCustomViews() error
- func (c *Configurator) RefreshStyles(s synchronizer)
- func (c *Configurator) SkinsDirWatcher(ctx context.Context, s synchronizer) error
- type Crumbs
- type DecorateFunc
- type Flash
- type KeyAction
- type KeyActions
- func (a *KeyActions) Add(k tcell.Key, ka KeyAction)
- func (a *KeyActions) Bulk(aa KeyMap)
- func (a *KeyActions) Clear()
- func (a *KeyActions) ClearDanger()
- func (a *KeyActions) Delete(kk ...tcell.Key)
- func (a *KeyActions) Get(key tcell.Key) (KeyAction, bool)
- func (a *KeyActions) Hints() model.MenuHints
- func (a *KeyActions) Len() int
- func (a *KeyActions) Merge(aa *KeyActions)
- func (a *KeyActions) Range(f RangeFn)
- func (a *KeyActions) Reset(aa *KeyActions)
- func (a *KeyActions) Set(aa *KeyActions)
- type KeyListenerFunc
- type KeyMap
- type Lister
- type Logo
- type MaxyPad
- type Menu
- type ModalList
- func (m *ModalList) Draw(screen tcell.Screen)
- func (m *ModalList) Focus(delegate func(p tview.Primitive))
- func (m *ModalList) HasFocus() bool
- func (m *ModalList) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
- func (m *ModalList) MouseHandler() ...
- func (m *ModalList) SetDoneFunc(handler func(int, string)) *ModalList
- type Namespaceable
- type Pages
- type Prompt
- func (p *Prompt) BufferActive(activate bool, kind model.BufferKind)
- func (p *Prompt) BufferChanged(text, suggestion string)
- func (p *Prompt) BufferCompleted(text, suggestion string)
- func (p *Prompt) Clear()
- func (p *Prompt) Deactivate()
- func (p *Prompt) Draw(sc tcell.Screen)
- func (p *Prompt) InCmdMode() bool
- func (p *Prompt) SendKey(evt *tcell.EventKey)
- func (p *Prompt) SendStrokes(s string)
- func (p *Prompt) SetModel(m PromptModel)
- func (p *Prompt) StylesChanged(s *config.Styles)
- func (p *Prompt) SuggestionChanged(text, suggestion string)
- type PromptModel
- type RangeFn
- type SelectTable
- func (s *SelectTable) ClearMarks()
- func (s *SelectTable) ClearSelection()
- func (s *SelectTable) DeleteMark(k string)
- func (s *SelectTable) GetModel() Tabular
- func (s *SelectTable) GetRowID(index int) (string, bool)
- func (s *SelectTable) GetSelectedCell(col int) string
- func (s *SelectTable) GetSelectedItem() string
- func (s *SelectTable) GetSelectedItems() []string
- func (s *SelectTable) GetSelectedRowIndex() int
- func (s *SelectTable) IsMarked(item string) bool
- func (s *SelectTable) SelectFirstRow()
- func (s *SelectTable) SelectRow(r, c int, broadcast bool)
- func (s *SelectTable) SetModel(m Tabular)
- func (s *SelectTable) SetSelectedFn(f func(string) string)
- func (s *SelectTable) SpanMark()
- func (s *SelectTable) ToggleMark()
- type SelectedRowFunc
- type Splash
- type StatusIndicator
- func (s *StatusIndicator) ClusterInfoChanged(prev, cur model.ClusterMeta)
- func (s *StatusIndicator) ClusterInfoUpdated(data model.ClusterMeta)
- func (s *StatusIndicator) Err(msg string)
- func (s *StatusIndicator) Info(msg string)
- func (s *StatusIndicator) Reset()
- func (s *StatusIndicator) SetPermanent(info string)
- func (s *StatusIndicator) StylesChanged(styles *config.Styles)
- func (s *StatusIndicator) Warn(msg string)
- type Suggester
- type Table
- func (t *Table) Actions() *KeyActions
- func (t *Table) AddHeaderCell(col int, h model1.HeaderColumn)
- func (t *Table) ClearMarks()
- func (t *Table) CmdBuff() *model.FishBuff
- func (t *Table) ExtraHints() map[string]string
- func (t *Table) Filter(q string)
- func (t *Table) FilterInput(r rune) bool
- func (t *Table) GVR() client.GVR
- func (t *Table) GetContext() context.Context
- func (t *Table) GetFilteredData() *model1.TableData
- func (t *Table) GetSelectedRow(path string) *model1.Row
- func (t *Table) Hints() model.MenuHints
- func (t *Table) Init(ctx context.Context)
- func (t *Table) NameColIndex() int
- func (t *Table) Refresh()
- func (t *Table) ResetToast()
- func (t *Table) SetColorerFn(f model1.ColorerFunc)
- func (t *Table) SetContext(ctx context.Context)
- func (t *Table) SetDecorateFn(f DecorateFunc)
- func (t *Table) SetSortCol(name string, asc bool)
- func (t *Table) ShowDeleted()
- func (t *Table) SortColCmd(name string, asc bool) func(evt *tcell.EventKey) *tcell.EventKey
- func (t *Table) SortInvertCmd(evt *tcell.EventKey) *tcell.EventKey
- func (t *Table) Styles() *config.Styles
- func (t *Table) StylesChanged(s *config.Styles)
- func (t *Table) ToggleToast()
- func (t *Table) ToggleWide()
- func (t *Table) Update(data *model1.TableData, hasMetrics bool) *model1.TableData
- func (t *Table) UpdateTitle()
- func (t *Table) UpdateUI(cdata, data *model1.TableData)
- func (t *Table) ViewSettingsChanged(vs config.ViewSetting)
- type Tabular
- type Tree
- func (t *Tree) Actions() *KeyActions
- func (t *Tree) BindKeys()
- func (t *Tree) ClearSelection()
- func (t *Tree) CmdBuff() *model.FishBuff
- func (t *Tree) ExpandNodes() bool
- func (t *Tree) ExtraHints() map[string]string
- func (t *Tree) GetSelectedItem() string
- func (t *Tree) Hints() model.MenuHints
- func (t *Tree) Init(ctx context.Context) error
- func (t *Tree) SetKeyListenerFn(f KeyListenerFunc)
- func (t *Tree) SetSelectedItem(s string)
Constants ¶
const ( // DeltaSign signals a diff. DeltaSign = "Δ" // PlusSign signals inc. PlusSign = "[red::b]↑" // MinusSign signal dec. MinusSign = "[green::b]↓" )
const ( Key0 tcell.Key = iota + 48 Key1 Key2 Key3 Key4 Key5 Key6 Key7 Key8 Key9 )
Defines numeric keys for container actions.
const ( KeyShift0 tcell.Key = 41 KeyShift1 tcell.Key = 33 KeyShift2 tcell.Key = 64 KeyShift3 tcell.Key = 35 KeyShift4 tcell.Key = 36 KeyShift5 tcell.Key = 37 KeyShift6 tcell.Key = 94 KeyShift7 tcell.Key = 38 KeyShift8 tcell.Key = 42 KeyShift9 tcell.Key = 40 )
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 KeySpace = 32 )
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.
const ( // DefaultColorName indicator to keep term colors. DefaultColorName = "default" // SearchFmt represents a filter view title. SearchFmt = "<[filter:bg:r]/%s[fg:bg:-]> " // NSTitleFmt represents a namespaced view title. NSTitleFmt = "[fg:bg:b] %s([hilite:bg:b]%s[fg:bg:-])[fg:bg:-][[count:bg:b]%s[fg:bg:-]][fg:bg:-] " // TitleFmt represents a standard view title. TitleFmt = "[fg:bg:b] %s[fg:bg:-][[count:bg:b]%s[fg:bg:-]][fg:bg:-] " // FullFmat specifies a namespaced dump file name. FullFmat = "%s-%s-%d.csv" // NoNSFmat specifies a cluster wide dump file name. NoNSFmat = "%s-%d.csv" )
Variables ¶
var LogoBig = []string{
` ____ __.________ _________ .____ .___ `,
`| |/ _/ __ \_____\_ ___ \| | | |`,
`| < \____ / ___/ \ \/| | | |`,
`| | \ / /\___ \\ \___| |___| |`,
`|____|__ \ /____//____ >\______ /_______ \___|`,
` \/ \/ \/ \/ `,
}
LogoBig K9s big logo for splash page.
var LogoSmall = []string{
` ____ __.________ `,
`| |/ _/ __ \______`,
`| < \____ / ___/`,
`| | \ / /\___ \ `,
`|____|__ \ /____//____ >`,
` \/ \/ `,
}
LogoSmall K9s small log.
var NumKeys = map[int]tcell.Key{ 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 AsPercDelta ¶
AsPercDelta represents a percentage with a delta indicator.
func ComputeMaxColumns ¶
ComputeMaxColumns figures out column max size and necessary padding.
func ToMnemonic ¶
func TrimCell ¶
func TrimCell(tv *SelectTable, row, col int) string
TrimCell removes superfluous padding.
func TrimLabelSelector ¶
TrimLabelSelector extracts label query.
Types ¶
type ActionHandler ¶
type ActionHandler func(*tcell.EventKey) *tcell.EventKey
ActionHandler handles a keyboard command.
type ActionOpts ¶
ActionOpts tracks various action options.
type App ¶
type App struct { *tview.Application Configurator Main *Pages // contains filtered or unexported fields }
App represents an application.
func (*App) AddActions ¶
func (a *App) AddActions(aa *KeyActions)
AddActions returns the application actions.
func (*App) BufferActive ¶
func (a *App) BufferActive(state bool, kind model.BufferKind)
BufferActive indicates the buff activity changed.
func (*App) BufferChanged ¶
BufferChanged indicates the buffer was changed.
func (*App) BufferCompleted ¶
BufferCompleted indicates input was accepted.
func (*App) GetActions ¶
func (a *App) GetActions() *KeyActions
GetActions returns a collection of actions.
func (*App) QueueUpdateDraw ¶
func (a *App) QueueUpdateDraw(f func())
QueueUpdateDraw queues up a ui action and redraw the ui.
func (*App) ResetPrompt ¶
func (a *App) ResetPrompt(m PromptModel)
ResetPrompt reset the prompt model and marks buffer as active.
func (*App) StylesChanged ¶
StylesChanged notifies the skin changed.
func (*App) SuggestionChanged ¶
SuggestionChanged notifies of update to command suggestions.
type ColorerFunc ¶
ColorerFunc represents a row colorer.
type Configurator ¶
type Configurator struct { Config *config.Config Styles *config.Styles CustomView *config.CustomView BenchFile string // contains filtered or unexported fields }
Configurator represents an application configuration.
func (*Configurator) ConfigWatcher ¶
func (c *Configurator) ConfigWatcher(ctx context.Context, s synchronizer) error
ConfigWatcher watches for skin settings changes.
func (*Configurator) CustomViewsWatcher ¶
func (c *Configurator) CustomViewsWatcher(ctx context.Context, s synchronizer) error
CustomViewsWatcher watches for view config file changes.
func (*Configurator) HasSkin ¶
func (c *Configurator) HasSkin() bool
HasSkin returns true if a skin file was located.
func (*Configurator) RefreshCustomViews ¶
func (c *Configurator) RefreshCustomViews() error
RefreshCustomViews load view configuration changes.
func (*Configurator) RefreshStyles ¶
func (c *Configurator) RefreshStyles(s synchronizer)
RefreshStyles load for skin configuration changes.
func (*Configurator) SkinsDirWatcher ¶
func (c *Configurator) SkinsDirWatcher(ctx context.Context, s synchronizer) error
SkinsDirWatcher watches for skin directory file changes.
type Crumbs ¶
Crumbs represents user breadcrumbs.
func (*Crumbs) StackPopped ¶
StackPopped indicates an item was deleted.
func (*Crumbs) StackPushed ¶
StackPushed indicates a new item was added.
func (*Crumbs) StylesChanged ¶
StylesChanged notifies skin changed.
type DecorateFunc ¶
DecorateFunc represents a row decorator.
type Flash ¶
Flash represents a flash message indicator.
func (*Flash) SetMessage ¶
func (f *Flash) SetMessage(m model.LevelMessage)
SetMessage sets flash message and level.
func (*Flash) StylesChanged ¶
StylesChanged notifies listener the skin changed.
type KeyAction ¶
type KeyAction struct { Description string Action ActionHandler Opts ActionOpts }
KeyAction represents a keyboard action.
func NewKeyAction ¶
func NewKeyAction(d string, a ActionHandler, visible bool) KeyAction
NewKeyAction returns a new keyboard action.
func NewKeyActionWithOpts ¶
func NewKeyActionWithOpts(d string, a ActionHandler, opts ActionOpts) KeyAction
NewKeyActionWithOpts returns a new keyboard action.
func NewSharedKeyAction ¶
func NewSharedKeyAction(d string, a ActionHandler, visible bool) KeyAction
NewSharedKeyAction returns a new shared keyboard action.
type KeyActions ¶
type KeyActions struct {
// contains filtered or unexported fields
}
KeyActions tracks mappings between keystrokes and actions.
func NewKeyActionsFromMap ¶
func NewKeyActionsFromMap(mm KeyMap) *KeyActions
NewKeyActionsFromMap construct actions from key map.
func (*KeyActions) Add ¶
func (a *KeyActions) Add(k tcell.Key, ka KeyAction)
Add adds a new key action.
func (*KeyActions) ClearDanger ¶
func (a *KeyActions) ClearDanger()
ClearDanger remove all dangerous actions.
func (*KeyActions) Delete ¶
func (a *KeyActions) Delete(kk ...tcell.Key)
Delete deletes actions by the given keys.
func (*KeyActions) Get ¶
func (a *KeyActions) Get(key tcell.Key) (KeyAction, bool)
Get fetches an action given a key.
func (*KeyActions) Hints ¶
func (a *KeyActions) Hints() model.MenuHints
Hints returns a collection of hints.
func (*KeyActions) Merge ¶
func (a *KeyActions) Merge(aa *KeyActions)
Merge merges given actions into existing set.
func (*KeyActions) Range ¶
func (a *KeyActions) Range(f RangeFn)
Range ranges over all actions and triggers a given function.
func (*KeyActions) Set ¶
func (a *KeyActions) Set(aa *KeyActions)
Set replace actions with new ones.
type Lister ¶
type Lister interface { // Get returns a resource instance. Get(ctx context.Context, path string) (runtime.Object, error) }
Lister represents a viewable resource.
type Logo ¶
Logo represents a K9s logo.
func (*Logo) IsBenchmarking ¶
IsBenchmarking checks if benchmarking is active or not.
func (*Logo) StylesChanged ¶
StylesChanged notifies the skin changed.
type Menu ¶
Menu presents menu options.
func (*Menu) HydrateMenu ¶
HydrateMenu populate menu ui from hints.
func (*Menu) StackPopped ¶
StackPopped notifies a component was removed.
func (*Menu) StackPushed ¶
StackPushed notifies a component was added.
func (*Menu) StylesChanged ¶
StylesChanged notifies skin changed.
type ModalList ¶
func (*ModalList) Draw ¶
func (m *ModalList) Draw(screen tcell.Screen)
Draw draws this primitive onto the screen.
func (*ModalList) InputHandler ¶
InputHandler returns the handler for this primitive.
func (*ModalList) MouseHandler ¶
func (m *ModalList) MouseHandler() func(action tview.MouseAction, event *tcell.EventMouse, setFocus func(p tview.Primitive)) (consumed bool, capture tview.Primitive)
MouseHandler returns the mouse handler for this primitive.
type Namespaceable ¶
type Namespaceable interface { // ClusterWide returns true if the model represents resource in all namespaces. ClusterWide() bool // GetNamespace returns the model namespace. GetNamespace() string // SetNamespace changes the model namespace. SetNamespace(string) // InNamespace check if current namespace matches models. InNamespace(string) bool }
Namespaceable represents a namespaceable model.
type Pages ¶
Pages represents a stack of view pages.
func (*Pages) IsTopDialog ¶
IsTopDialog checks if front page is a dialog.
func (*Pages) StackPopped ¶
StackPopped notifies a component was removed.
func (*Pages) StackPushed ¶
StackPushed notifies a new component was pushed.
type Prompt ¶
Prompt captures users free from command input.
func (*Prompt) BufferActive ¶
func (p *Prompt) BufferActive(activate bool, kind model.BufferKind)
BufferActive indicates the buff activity changed.
func (*Prompt) BufferChanged ¶
BufferChanged indicates the buffer was changed.
func (*Prompt) BufferCompleted ¶
BufferCompleted indicates input was accepted.
func (*Prompt) SendKey ¶
func (p *Prompt) SendKey(evt *tcell.EventKey)
SendKey sends an keyboard event (testing only!).
func (*Prompt) SetModel ¶
func (p *Prompt) SetModel(m PromptModel)
SetModel sets the prompt buffer model.
func (*Prompt) StylesChanged ¶
StylesChanged notifies skin changed.
func (*Prompt) SuggestionChanged ¶
SuggestionChanged notifies the suggestion changed.
type PromptModel ¶
type PromptModel interface { // SetText sets the model text. SetText(txt, sug string) // GetText returns the current text. GetText() string // GetSuggestion returns the current suggestion. GetSuggestion() string // ClearText clears out model text. ClearText(fire bool) // Notify notifies all listener of current suggestions. Notify(bool) // AddListener registers a command listener. AddListener(model.BuffWatcher) // RemoveListener removes a listener. RemoveListener(model.BuffWatcher) // IsActive returns true if prompt is active. IsActive() bool // SetActive sets whether the prompt is active or not. SetActive(bool) // Add adds a new char to the prompt. Add(rune) // Delete deletes the last prompt character. Delete() }
PromptModel represents a prompt buffer.
type RangeFn ¶
type RangeFn func(tcell.Key, KeyAction)
RangeFn represents a range iteration callback.
type SelectTable ¶
SelectTable represents a table with selections.
func (*SelectTable) ClearMarks ¶
func (s *SelectTable) ClearMarks()
ClearMarks delete all marked items.
func (*SelectTable) ClearSelection ¶
func (s *SelectTable) ClearSelection()
ClearSelection reset selected row.
func (*SelectTable) DeleteMark ¶
func (s *SelectTable) DeleteMark(k string)
DeleteMark delete a marked item.
func (*SelectTable) GetModel ¶
func (s *SelectTable) GetModel() Tabular
GetModel returns the current model.
func (*SelectTable) GetRowID ¶
func (s *SelectTable) GetRowID(index int) (string, bool)
GetRowID returns the row id at given location.
func (*SelectTable) GetSelectedCell ¶
func (s *SelectTable) GetSelectedCell(col int) string
GetSelectedCell returns the content of a cell for the currently selected row.
func (*SelectTable) GetSelectedItem ¶
func (s *SelectTable) GetSelectedItem() string
GetSelectedItem returns the currently selected item name.
func (*SelectTable) GetSelectedItems ¶
func (s *SelectTable) GetSelectedItems() []string
GetSelectedItems return currently marked or selected items names.
func (*SelectTable) GetSelectedRowIndex ¶
func (s *SelectTable) GetSelectedRowIndex() int
GetSelectedRowIndex fetch the currently selected row index.
func (*SelectTable) IsMarked ¶
func (s *SelectTable) IsMarked(item string) bool
IsMarked returns true if this item was marked.
func (*SelectTable) SelectFirstRow ¶
func (s *SelectTable) SelectFirstRow()
SelectFirstRow select first data row if any.
func (*SelectTable) SelectRow ¶
func (s *SelectTable) SelectRow(r, c int, broadcast bool)
SelectRow select a given row by index.
func (*SelectTable) SetModel ¶
func (s *SelectTable) SetModel(m Tabular)
SetModel sets the table model.
func (*SelectTable) SetSelectedFn ¶
func (s *SelectTable) SetSelectedFn(f func(string) string)
SetSelectedFn defines a function that cleanse the current selection.
type StatusIndicator ¶
StatusIndicator represents a status indicator when main header is collapsed.
func NewStatusIndicator ¶
func NewStatusIndicator(app *App, styles *config.Styles) *StatusIndicator
NewStatusIndicator returns a new status indicator.
func (*StatusIndicator) ClusterInfoChanged ¶
func (s *StatusIndicator) ClusterInfoChanged(prev, cur model.ClusterMeta)
ClusterInfoChanged notifies the cluster meta was changed.
func (*StatusIndicator) ClusterInfoUpdated ¶
func (s *StatusIndicator) ClusterInfoUpdated(data model.ClusterMeta)
ClusterInfoUpdated notifies the cluster meta was updated.
func (*StatusIndicator) Err ¶
func (s *StatusIndicator) Err(msg string)
Err displays a log error state.
func (*StatusIndicator) Info ¶
func (s *StatusIndicator) Info(msg string)
Info displays a log info state.
func (*StatusIndicator) Reset ¶
func (s *StatusIndicator) Reset()
Reset clears out the logo view and resets colors.
func (*StatusIndicator) SetPermanent ¶
func (s *StatusIndicator) SetPermanent(info string)
SetPermanent sets permanent title to be reset to after updates.
func (*StatusIndicator) StylesChanged ¶
func (s *StatusIndicator) StylesChanged(styles *config.Styles)
StylesChanged notifies the skins changed.
func (*StatusIndicator) Warn ¶
func (s *StatusIndicator) Warn(msg string)
Warn displays a log warning state.
type Suggester ¶
type Suggester interface { // CurrentSuggestion returns the current suggestion. CurrentSuggestion() (string, bool) // NextSuggestion returns the next suggestion. NextSuggestion() (string, bool) // PrevSuggestion returns the prev suggestion. PrevSuggestion() (string, bool) // ClearSuggestions clear out all suggestions. ClearSuggestions() }
Suggester provides suggestions.
type Table ¶
type Table struct { Path string Extras string *SelectTable // contains filtered or unexported fields }
Table represents tabular data.
func (*Table) AddHeaderCell ¶
func (t *Table) AddHeaderCell(col int, h model1.HeaderColumn)
AddHeaderCell configures a table cell header.
func (*Table) ExtraHints ¶
ExtraHints returns additional hints.
func (*Table) FilterInput ¶
FilterInput filters user commands.
func (*Table) GetContext ¶
func (*Table) GetFilteredData ¶
GetFilteredData fetch filtered tabular data.
func (*Table) GetSelectedRow ¶
GetSelectedRow returns the entire selected row or nil if nothing selected.
func (*Table) NameColIndex ¶
NameColIndex returns the index of the resource name column.
func (*Table) SetColorerFn ¶
func (t *Table) SetColorerFn(f model1.ColorerFunc)
SetColorerFn specifies the default colorer.
func (*Table) SetContext ¶
func (*Table) SetDecorateFn ¶
func (t *Table) SetDecorateFn(f DecorateFunc)
SetDecorateFn specifies the default row decorator.
func (*Table) SetSortCol ¶
SetSortCol sets in sort column index and order.
func (*Table) SortColCmd ¶
SortColCmd designates a sorted column.
func (*Table) SortInvertCmd ¶
func (t *Table) SortInvertCmd(evt *tcell.EventKey) *tcell.EventKey
SortInvertCmd reverses sorting order.
func (*Table) StylesChanged ¶
StylesChanged notifies the skin changed.
func (*Table) ToggleToast ¶
func (t *Table) ToggleToast()
ToggleToast toggles to show toast resources.
func (*Table) ViewSettingsChanged ¶
func (t *Table) ViewSettingsChanged(vs config.ViewSetting)
ViewSettingsChanged notifies listener the view configuration changed.
type Tabular ¶
type Tabular interface { Namespaceable Lister // SetInstance sets parent resource path. SetInstance(string) // SetLabelFilter sets the label filter. SetLabelFilter(string) // GetLabelFilter fetch the label filter. GetLabelFilter() string // Empty returns true if model has no data. Empty() bool // RowCount returns the model data count. RowCount() int // Peek returns current model data. Peek() *model1.TableData // Watch watches a given resource for changes. Watch(context.Context) error // Refresh forces a new refresh. Refresh(context.Context) error // SetRefreshRate sets the model watch loop rate. SetRefreshRate(time.Duration) // AddListener registers a model listener. AddListener(model.TableListener) // RemoveListener unregister a model listener. RemoveListener(model.TableListener) // Delete a resource. Delete(context.Context, string, *metav1.DeletionPropagation, dao.Grace) error }
Tabular represents a tabular model.
type Tree ¶
Tree represents a tree view.
func (*Tree) ClearSelection ¶
func (t *Tree) ClearSelection()
ClearSelection clears the currently selected node.
func (*Tree) ExpandNodes ¶
ExpandNodes returns true if nodes are expanded or false otherwise.
func (*Tree) ExtraHints ¶
ExtraHints returns additional hints.
func (*Tree) GetSelectedItem ¶
GetSelectedItem returns the currently selected item or blank if none.
func (*Tree) SetKeyListenerFn ¶
func (t *Tree) SetKeyListenerFn(f KeyListenerFunc)
SetKeyListenerFn sets a key entered listener.
func (*Tree) SetSelectedItem ¶
SetSelectedItem sets the currently selected node.