Documentation ¶
Index ¶
- Constants
- Variables
- func AlignStringListWidth(list []string) ([]string, int)
- func EmptyBoxSpace(bgColor tcell.Color) *tview.Box
- func GetIDWithLimit(id string) string
- func ParseKeyEventKey(event *tcell.EventKey) *tcell.EventKey
- func ProgressUsageString(percentage float64) string
- func ResolveHomeDir(path string) (string, error)
- func StringToEventKey(input string) []*tcell.EventKey
- func UserHomeDir() (string, error)
- func ValidURL(urlStr string) error
- func ValidateFileName(filename string) error
- type UiDialog
Constants ¶
View Source
const ( // IDLength max ID length to display IDLength = 12 // RefreshInterval application refresh interval RefreshInterval = 1000 * time.Millisecond )
Variables ¶
View Source
var ( CommandMenuKey = uiKeyInfo{ Key: tcell.Key(256), KeyRune: rune('m'), KeyLabel: "m", KeyDesc: "display command menu", } NextScreenKey = uiKeyInfo{ Key: tcell.Key(256), KeyRune: rune('l'), KeyLabel: "l", KeyDesc: "switch to next screen", } PreviousScreenKey = uiKeyInfo{ Key: tcell.Key(256), KeyRune: rune('h'), KeyLabel: "h", KeyDesc: "switch to previous screen", } MoveUpKey = uiKeyInfo{ Key: tcell.KeyUp, KeyRune: rune('k'), KeyLabel: "k", KeyDesc: "move up", } MoveDownKey = uiKeyInfo{ Key: tcell.KeyDown, KeyRune: rune('j'), KeyLabel: "j", KeyDesc: "move down", } CloseDialogKey = uiKeyInfo{ Key: tcell.KeyEsc, KeyLabel: "Esc", KeyDesc: "close the active dialog", } SwitchFocusKey = uiKeyInfo{ Key: tcell.KeyTab, KeyLabel: "Tab", KeyDesc: "switch between widgets", } DeleteKey = uiKeyInfo{ Key: tcell.KeyDelete, KeyLabel: "Delete", KeyDesc: "delete the selected item", } ArrowUpKey = uiKeyInfo{ Key: tcell.KeyUp, KeyLabel: "Arrow Up", KeyDesc: "move up", } ArrowDownKey = uiKeyInfo{ Key: tcell.KeyDown, KeyLabel: "Arrow Down", KeyDesc: "move down", } ArrowLeftKey = uiKeyInfo{ Key: tcell.KeyLeft, KeyLabel: "Arrow Left", KeyDesc: "previous screen", } ArrowRightKey = uiKeyInfo{ Key: tcell.KeyRight, KeyLabel: "Arrow Right", KeyDesc: "next screen", } ScrollUpKey = uiKeyInfo{ Key: tcell.KeyPgUp, KeyLabel: "Page Up", KeyDesc: "scroll up", } ScrollDownKey = uiKeyInfo{ Key: tcell.KeyPgDn, KeyLabel: "Page Down", KeyDesc: "scroll down", } AppExitKey = uiKeyInfo{ Key: tcell.KeyCtrlC, KeyLabel: "Ctrl+c", KeyDesc: "exit application", } HelpScreenKey = uiKeyInfo{ Key: tcell.KeyF1, KeyLabel: "F1", KeyDesc: "display help screen", } SystemScreenKey = uiKeyInfo{ Key: tcell.KeyF2, KeyLabel: "F2", KeyDesc: "display system screen", } PodsScreenKey = uiKeyInfo{ Key: tcell.KeyF3, KeyLabel: "F3", KeyDesc: "display pods screen", } ContainersScreenKey = uiKeyInfo{ Key: tcell.KeyF4, KeyLabel: "F4", KeyDesc: "display containers screen", } VolumesScreenKey = uiKeyInfo{ Key: tcell.KeyF5, KeyLabel: "F5", KeyDesc: "display volumes screen", } ImagesScreenKey = uiKeyInfo{ Key: tcell.KeyF6, KeyLabel: "F6", KeyDesc: "display images screen", } NetworksScreenKey = uiKeyInfo{ Key: tcell.KeyF7, KeyLabel: "F7", KeyDesc: "display networks screen", } )
application key bindings names
View Source
var ( // UIKeysBindings user interface key bindings UIKeysBindings = []uiKeyInfo{ CommandMenuKey, NextScreenKey, PreviousScreenKey, MoveUpKey, MoveDownKey, CloseDialogKey, SwitchFocusKey, DeleteKey, ArrowUpKey, ArrowDownKey, ArrowLeftKey, ArrowRightKey, ScrollUpKey, ScrollDownKey, AppExitKey, HelpScreenKey, SystemScreenKey, PodsScreenKey, ContainersScreenKey, VolumesScreenKey, ImagesScreenKey, NetworksScreenKey, } )
Functions ¶
func AlignStringListWidth ¶
AlignStringListWidth returns max string len in the list.
func EmptyBoxSpace ¶ added in v0.2.0
EmptyBoxSpace returns simple Box without border with bgColor as background
func GetIDWithLimit ¶ added in v0.7.0
GetIDWithLimit return ID string with limited string characters
func ParseKeyEventKey ¶ added in v0.2.0
func ParseKeyEventKey(event *tcell.EventKey) *tcell.EventKey
ParseKeyEventKey parsed and changes key events key and rune base on keyname
func ProgressUsageString ¶ added in v0.2.0
ProgressUsageString return progressbar string (bars + usage percentage)
func ResolveHomeDir ¶ added in v0.3.1
ResolveHomeDir converts a path referencing the home directory via "~" to an absolute path
func StringToEventKey ¶ added in v0.5.0
func StringToEventKey(input string) []*tcell.EventKey
StringToEventKey returns list of key events equvalant to the input string
func UserHomeDir ¶ added in v0.4.0
UserHomeDir returns user's home directory
func ValidateFileName ¶ added in v0.3.1
ValidateFileName returns an error if filename contains ":" as it is currently not supported
Types ¶
Click to show internal directories.
Click to hide internal directories.