Documentation ¶
Index ¶
- Constants
- Variables
- func AsKey(evt *tcell.EventKey) tcell.Key
- func CalculateMaxWidths(table *tview.Table) []int
- func CleanTable(table *tview.Table)
- func CleanTableRows(table *tview.Table, exists func(row int) bool)
- func LogoString() string
- func NewDummy(ctx context.Context) error
- func NewHeaderTableCell(text string) *tview.TableCell
- func NewResource(ctx context.Context, parent Page, apiGroup *discoverypb.APIResource)
- func NewResourceInstance(ctx context.Context, parent Page, u *unstructured.Unstructured)
- func NewResources(ctx context.Context, parent Page)
- func NewTicker(app *tview.Application, frequency time.Duration, f func()) *ticker
- func SetTableHeader(table *tview.Table, maxColumnWidth []int, headers ...string)
- func YamlToString(u *unstructured.Unstructured) string
- type ActionHandler
- type App
- type ContextKey
- type Dummy
- type Info
- type KeyActions
- type Logo
- type Menu
- type Page
- type Resource
- func (r *Resource) Activate(ctx context.Context)
- func (r *Resource) DataTableName() string
- func (r *Resource) FindResourceInstanceRow(resourceID string) int
- func (r *Resource) GetResourceInstanceRow(row int) string
- func (r *Resource) HeaderTableName() string
- func (r *Resource) Name() string
- func (r *Resource) SetResourceInstanceRow(row int, u *unstructured.Unstructured)
- func (r *Resource) Update(ctx context.Context) error
- type ResourceInstance
- type Resources
- func (r *Resources) Activate(ctx context.Context)
- func (r *Resources) DataTableName() string
- func (r *Resources) FindResourcesRow(resourceID string) int
- func (r *Resources) GetResourcesRow(row int) string
- func (r *Resources) HeaderTableName() string
- func (r *Resources) Name() string
- func (r *Resources) SetResourcesRow(row int, resource *discoverypb.APIResource)
- func (r *Resources) Update(ctx context.Context) error
- type YAMLStyle
Constants ¶
View Source
const ( Key0 tcell.Key = iota + 48 Key1 Key2 Key3 Key4 Key5 Key6 Key7 Key8 Key9 )
Defines numeric keys for container actions.
View Source
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.
View Source
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.
View Source
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 ¶
View Source
var LogoSmall = []string{
` ____ _ _ ___ ____ _____ ___ `,
` / ___| | | |/ _ \| _ \| ____/ _ \ `,
`| | | |_| | | | | |_) | _|| | | | `,
`| |___| _ | |_| | _ <| |__| |_| | `,
` \____|_| |_|\___/|_| \_\_____\___/ `,
}
View Source
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 CalculateMaxWidths ¶
func CleanTable ¶
func LogoString ¶
func LogoString() string
func NewHeaderTableCell ¶
func NewResource ¶
func NewResource(ctx context.Context, parent Page, apiGroup *discoverypb.APIResource)
func NewResourceInstance ¶
func NewResourceInstance(ctx context.Context, parent Page, u *unstructured.Unstructured)
func NewResources ¶
func SetTableHeader ¶
func YamlToString ¶
func YamlToString(u *unstructured.Unstructured) string
Types ¶
type App ¶
type App struct { *tview.Application Main *tview.Pages // this might have to become a stack // contains filtered or unexported fields }
type ContextKey ¶
type ContextKey string
ContextKey represents context key.
const (
KeyApp ContextKey = "app"
)
A collection of context keys.
type Info ¶
func (*Info) SetKeyValue ¶
type KeyActions ¶
type KeyActions struct {
// contains filtered or unexported fields
}
KeyActions tracks mappings between keystrokes and actions.
func NewKeyActions ¶
func NewKeyActions() *KeyActions
func (*KeyActions) Add ¶
func (a *KeyActions) Add(k tcell.Key, h ActionHandler)
Add adds a new key action.
func (*KeyActions) Get ¶
func (a *KeyActions) Get(key tcell.Key) (ActionHandler, bool)
type Resource ¶
type Resource struct { HeaderTable *tview.Table DataTable *tview.Table // contains filtered or unexported fields }
func (*Resource) DataTableName ¶
func (*Resource) FindResourceInstanceRow ¶
func (*Resource) GetResourceInstanceRow ¶
func (*Resource) HeaderTableName ¶
func (*Resource) SetResourceInstanceRow ¶
func (r *Resource) SetResourceInstanceRow(row int, u *unstructured.Unstructured)
type ResourceInstance ¶
func (*ResourceInstance) Activate ¶
func (r *ResourceInstance) Activate(ctx context.Context)
func (*ResourceInstance) Name ¶
func (r *ResourceInstance) Name() string
type Resources ¶
type Resources struct { HeaderTable *tview.Table DataTable *tview.Table // contains filtered or unexported fields }
func (*Resources) DataTableName ¶
func (*Resources) FindResourcesRow ¶
func (*Resources) GetResourcesRow ¶
func (*Resources) HeaderTableName ¶
func (*Resources) SetResourcesRow ¶
func (r *Resources) SetResourcesRow(row int, resource *discoverypb.APIResource)
Click to show internal directories.
Click to hide internal directories.