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 DeleteRow(table *tview.Table, index int)
- func GetBranchRowData(branch *branchpb.BranchObject) []string
- func GetResourceInstanceID(u *unstructured.Unstructured) string
- func GetResourceInstanceRowData(u *unstructured.Unstructured) []string
- func GetResourceRowData(resource *discoverypb.APIResource) []string
- func InsertRowAt(table *tview.Table, index int, ref any, rowData []string, style tcell.Style)
- func LogoString() string
- func NewHeaderTableCell(text string) *tview.TableCell
- func NewTicker(app *tview.Application, frequency time.Duration, f func()) *ticker
- func SetMenuRow(table *tview.Table, row int, key, val string, keyStyle, valStyle tcell.Style)
- func SetTableHeader(table *tview.Table, maxColumnWidth []int, headers ...string)
- func UpdateRowAt(table *tview.Table, index int, ref any, rowData []string, style tcell.Style)
- func YamlToString(u *unstructured.Unstructured) string
- type ActionHandler
- type App
- type BranchMenu
- type BranchPage
- func (r *BranchPage) ActivatePage(ctx context.Context)
- func (r *BranchPage) DeActivatePage(ctx context.Context)
- func (r *BranchPage) HandleInput(event *tcell.EventKey) *tcell.EventKey
- func (r *BranchPage) RegisterPageAction(ctx context.Context)
- func (r *BranchPage) SetTable(ctx context.Context)
- func (r *BranchPage) SetView()
- func (r *BranchPage) StartStream(ctx context.Context)
- func (r *BranchPage) StopStream(ctx context.Context)
- type CommandMenu
- type ContextKey
- type Dummy
- func (r *Dummy) ActivatePage(ctx context.Context)
- func (r *Dummy) DeActivatePage(ctx context.Context)
- func (r *Dummy) RegisterPageAction(ctx context.Context)
- func (r *Dummy) SetTextView(ctx context.Context)
- func (r *Dummy) SetView()
- func (r *Dummy) TviewPrimitive() tview.Primitive
- func (r *Dummy) Update(ctx context.Context) error
- type Header
- type IdentifierSet
- type Info
- type KeyAction
- type KeyActions
- type Logo
- type Page
- func NewBranchPage(ctx context.Context, pages *Pages) Page
- func NewDummy(ctx context.Context, pages *Pages) Page
- func NewResource(ctx context.Context, parent Page, apiGroup *discoverypb.APIResource) Page
- func NewResourceInstance(ctx context.Context, parent Page, u *unstructured.Unstructured) Page
- func NewResources(ctx context.Context, pages *Pages) Page
- type Pages
- type Resource
- func (r *Resource) ActivatePage(ctx context.Context)
- func (r *Resource) DeActivatePage(ctx context.Context)
- func (r *Resource) HandleInput(event *tcell.EventKey) *tcell.EventKey
- func (r *Resource) RegisterPageAction(ctx context.Context)
- func (r *Resource) SetTable(ctx context.Context)
- func (r *Resource) SetView()
- func (r *Resource) StartStream(ctx context.Context)
- func (r *Resource) StopStream(ctx context.Context)
- type ResourceInstance
- func (r *ResourceInstance) ActivatePage(ctx context.Context)
- func (r *ResourceInstance) DeActivatePage(ctx context.Context)
- func (r *ResourceInstance) HandleInput(event *tcell.EventKey) *tcell.EventKey
- func (r *ResourceInstance) RegisterPageAction(ctx context.Context)
- func (r *ResourceInstance) SetTextView(ctx context.Context)
- func (r *ResourceInstance) SetView()
- func (r *ResourceInstance) Update(ctx context.Context) error
- type Resources
- func (r *Resources) ActivatePage(ctx context.Context)
- func (r *Resources) DeActivatePage(ctx context.Context)
- func (r *Resources) HandleInput(event *tcell.EventKey) *tcell.EventKey
- func (r *Resources) RegisterPageAction(ctx context.Context)
- func (r *Resources) SetTable(ctx context.Context)
- func (r *Resources) SetView()
- func (r *Resources) StartStream(parentCtx context.Context)
- func (r *Resources) StopStream(ctx context.Context)
- type YAMLStyle
Constants ¶
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.
Variables ¶
var LogoSmall = []string{
` ____ _ _ ___ ____ _____ ___ `,
` / ___| | | |/ _ \| _ \| ____/ _ \ `,
`| | | |_| | | | | |_) | _|| | | | `,
`| |___| _ | |_| | _ <| |__| |_| | `,
` \____|_| |_|\___/|_| \_\_____\___/ `,
}
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 GetBranchRowData ¶
func GetBranchRowData(branch *branchpb.BranchObject) []string
func GetResourceInstanceID ¶
func GetResourceInstanceID(u *unstructured.Unstructured) string
func GetResourceInstanceRowData ¶
func GetResourceInstanceRowData(u *unstructured.Unstructured) []string
func GetResourceRowData ¶
func GetResourceRowData(resource *discoverypb.APIResource) []string
func InsertRowAt ¶
InsertRowAt inserts a new row into the table at the specified position
func LogoString ¶
func LogoString() string
func NewHeaderTableCell ¶
func SetMenuRow ¶
func SetTableHeader ¶
func UpdateRowAt ¶
InsertRowAt inserts a new row into the table at the specified position
func YamlToString ¶
func YamlToString(u *unstructured.Unstructured) string
Types ¶
type App ¶
type App struct { *tview.Application // contains filtered or unexported fields }
func (*App) HandleInput ¶
func (a *App) HandleInput(event *tcell.EventKey) *tcell.EventKey
In your page implementation
type BranchMenu ¶
func (*BranchMenu) ActivatePageAction ¶
func (r *BranchMenu) ActivatePageAction()
ActivateAction propogates the actions populate the cmdMenu
func (*BranchMenu) InitPageAction ¶
func (r *BranchMenu) InitPageAction()
type BranchPage ¶
type BranchPage struct { HeaderTable *tview.Table DataTable *tview.Table // contains filtered or unexported fields }
func (*BranchPage) ActivatePage ¶
func (r *BranchPage) ActivatePage(ctx context.Context)
func (*BranchPage) DeActivatePage ¶
func (r *BranchPage) DeActivatePage(ctx context.Context)
func (*BranchPage) HandleInput ¶
func (r *BranchPage) HandleInput(event *tcell.EventKey) *tcell.EventKey
In your page implementation
func (*BranchPage) RegisterPageAction ¶
func (r *BranchPage) RegisterPageAction(ctx context.Context)
func (*BranchPage) SetTable ¶
func (r *BranchPage) SetTable(ctx context.Context)
func (*BranchPage) SetView ¶
func (r *BranchPage) SetView()
func (*BranchPage) StartStream ¶
func (r *BranchPage) StartStream(ctx context.Context)
func (*BranchPage) StopStream ¶
func (r *BranchPage) StopStream(ctx context.Context)
type CommandMenu ¶
func (*CommandMenu) ActivatePageAction ¶
func (r *CommandMenu) ActivatePageAction()
ActivateAction propogates the actions populate the cmdMenu
func (*CommandMenu) InitPageAction ¶
func (r *CommandMenu) InitPageAction()
type ContextKey ¶
type ContextKey string
ContextKey represents context key.
const (
KeyApp ContextKey = "app"
)
A collection of context keys.
type Dummy ¶
func (*Dummy) ActivatePage ¶
func (*Dummy) DeActivatePage ¶
func (*Dummy) RegisterPageAction ¶
func (*Dummy) SetTextView ¶
func (*Dummy) TviewPrimitive ¶
type Header ¶
func (*Header) ActivatePageAction ¶
func (*Header) InitPageAction ¶
func (r *Header) InitPageAction()
func (*Header) SwitchLayout ¶
type IdentifierSet ¶
type IdentifierSet struct {
// contains filtered or unexported fields
}
IdentifierSet manages a set of identifiers.
func NewIdentifierSet ¶
func NewIdentifierSet() *IdentifierSet
NewIdentifierSet creates a new IdentifierSet.
func (*IdentifierSet) AddIdentifier ¶
func (s *IdentifierSet) AddIdentifier(id string) (int, bool)
AddIdentifier adds a new identifier to the set and returns the position it was added at, or the existing position if it was already present.
func (*IdentifierSet) DeleteIdentifier ¶
func (s *IdentifierSet) DeleteIdentifier(id string) int
type Info ¶
func (*Info) SetKeyValue ¶
type KeyAction ¶
type KeyAction struct { Key tcell.Key Description string ShortName string Action ActionHandler }
KeyAction represents a keyboard action.
type KeyActions ¶
type KeyActions struct {
// contains filtered or unexported fields
}
KeyActions tracks mappings between keystrokes and actions.
func NewKeyActions ¶
func NewKeyActions() *KeyActions
func (*KeyActions) List ¶
func (a *KeyActions) List(visitorFunc func(string, KeyAction))
func (*KeyActions) MapKeys ¶
func (r *KeyActions) MapKeys() map[string]int
type Page ¶
type Page interface { ActivatePage(ctx context.Context) // registers the keys of the page to the // actions per app and the cmd header RegisterPageAction(ctx context.Context) }
func NewResource ¶
func NewResource(ctx context.Context, parent Page, apiGroup *discoverypb.APIResource) Page
func NewResourceInstance ¶
func NewResourceInstance(ctx context.Context, parent Page, u *unstructured.Unstructured) Page
type Pages ¶
func (*Pages) RegisterPageAction ¶
type Resource ¶
type Resource struct { HeaderTable *tview.Table DataTable *tview.Table // contains filtered or unexported fields }
func (*Resource) ActivatePage ¶
func (*Resource) DeActivatePage ¶
func (*Resource) HandleInput ¶
func (r *Resource) HandleInput(event *tcell.EventKey) *tcell.EventKey
In your page implementation
func (*Resource) RegisterPageAction ¶
func (*Resource) StartStream ¶
func (*Resource) StopStream ¶
type ResourceInstance ¶
func (*ResourceInstance) ActivatePage ¶
func (r *ResourceInstance) ActivatePage(ctx context.Context)
func (*ResourceInstance) DeActivatePage ¶
func (r *ResourceInstance) DeActivatePage(ctx context.Context)
func (*ResourceInstance) HandleInput ¶
func (r *ResourceInstance) HandleInput(event *tcell.EventKey) *tcell.EventKey
In your page implementation
func (*ResourceInstance) RegisterPageAction ¶
func (r *ResourceInstance) RegisterPageAction(ctx context.Context)
func (*ResourceInstance) SetTextView ¶
func (r *ResourceInstance) SetTextView(ctx context.Context)
func (*ResourceInstance) SetView ¶
func (r *ResourceInstance) SetView()
type Resources ¶
type Resources struct { HeaderTable *tview.Table DataTable *tview.Table // contains filtered or unexported fields }
func (*Resources) ActivatePage ¶
func (*Resources) DeActivatePage ¶
func (*Resources) HandleInput ¶
func (r *Resources) HandleInput(event *tcell.EventKey) *tcell.EventKey
In your page implementation