shared

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TabsBarHeight = 3
	HelpBarHeight = 2
	FullScreen    = -1
)
View Source
const (
	TimeFormat = "2006-01-02 15:04:05"
)

Variables

This section is empty.

Functions

func GetTextWithLen

func GetTextWithLen(source string, length int) string

func Max

func Max(a, b int) int

Max returns max of two integers.

Types

type App

type App struct {
	CurrentNamespace string
	CurrentTab       TabItem
	Styles           *themes.Styles
	KeyMap           *KeyMap
	GUI              GUI
	// contains filtered or unexported fields
}

func NewApp

func NewApp(theme themes.Theme) *App

func (*App) AddUpdateNamespaceCallback

func (app *App) AddUpdateNamespaceCallback(fn func())

func (*App) OnUpdateNamespace

func (app *App) OnUpdateNamespace()

func (*App) ResizeAreas

func (app *App) ResizeAreas()

type GUI

type GUI struct {
	ScreenHeight int
	ScreenWidth  int
	Areas        *uiAreas
}

type KeyMap

type KeyMap struct {
	Tab        key.Binding
	ShiftTab   key.Binding
	Up         key.Binding
	Down       key.Binding
	PrevPage   key.Binding
	NextPage   key.Binding
	FocusRight key.Binding
	FocusLeft  key.Binding
	Select     key.Binding
	Help       key.Binding
	HelpShort  key.Binding
	Quit       key.Binding
}

func GetKeyMaps

func GetKeyMaps() KeyMap

GetKeyMaps returns all the shortcuts available.

func (KeyMap) FullHelp

func (k KeyMap) FullHelp() [][]key.Binding

func (KeyMap) FullWithFocus added in v0.0.2

func (k KeyMap) FullWithFocus() [][]key.Binding

func (KeyMap) ShortHelp

func (k KeyMap) ShortHelp() []key.Binding

func (KeyMap) ShortWithFocus added in v0.0.2

func (k KeyMap) ShortWithFocus() []key.Binding

type TabItem

type TabItem int

TabItem is kind of identifier for tabs. It differs from `elements/tab` which is responsible for look and style, and which is data agnostic. TabItem, on the contrary, represents a concrete tab with a concrete title and related with a specific content.

const (
	NamespacesTab TabItem = iota
	DeploymentsTab
	PodsTab
	AnyTab // used for elements that don't belong to any tab. As example, tabs themselves.
)

TabItem tabs.

func GetTabItems

func GetTabItems() []TabItem

GetTabItems returns the list of all available (visually) tabs.

func (TabItem) String

func (t TabItem) String() string

String is a string representation of TabItems.

Directories

Path Synopsis
elements
divider
Package divider keeps helpers to draw dividers.
Package divider keeps helpers to draw dividers.
Package themes keeps default styles.
Package themes keeps default styles.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL