Documentation ¶
Index ¶
- type EventDetailsWidget
- func (e *EventDetailsWidget) Draw(buf *ui.Buffer)
- func (e *EventDetailsWidget) Filter() api.Filter
- func (e *EventDetailsWidget) Pause() bool
- func (e *EventDetailsWidget) SelectBottom()
- func (e *EventDetailsWidget) SelectHalfPageDown()
- func (e *EventDetailsWidget) SelectHalfPageUp()
- func (e *EventDetailsWidget) SelectNext()
- func (e *EventDetailsWidget) SelectPageDown()
- func (e *EventDetailsWidget) SelectPageUp()
- func (e *EventDetailsWidget) SelectPrev()
- func (e *EventDetailsWidget) SelectTop()
- func (e *EventDetailsWidget) SelectedValues() []string
- func (e *EventDetailsWidget) SetSortAndFilter(sortorder api.Sort, filter api.Filter)
- func (e *EventDetailsWidget) Sortorder() api.Sort
- func (e *EventDetailsWidget) TogglePause()
- func (e *EventDetailsWidget) Update() error
- type EventsWidget
- func (e *EventsWidget) Filter() api.Filter
- func (e *EventsWidget) Pause() bool
- func (e *EventsWidget) SelectBottom()
- func (e *EventsWidget) SelectHalfPageDown()
- func (e *EventsWidget) SelectHalfPageUp()
- func (e *EventsWidget) SelectNext()
- func (e *EventsWidget) SelectPageDown()
- func (e *EventsWidget) SelectPageUp()
- func (e *EventsWidget) SelectPrev()
- func (e *EventsWidget) SelectTop()
- func (e *EventsWidget) SelectedValues() []string
- func (e *EventsWidget) SetSortAndFilter(sortorder api.Sort, filter api.Filter)
- func (e *EventsWidget) Sortorder() api.Sort
- func (e *EventsWidget) TogglePause()
- func (e *EventsWidget) Update() error
- type ListType
- type ListWidget
- type NodesWidget
- func (n *NodesWidget) Filter() api.Filter
- func (n *NodesWidget) Pause() bool
- func (n *NodesWidget) SelectBottom()
- func (n *NodesWidget) SelectHalfPageDown()
- func (n *NodesWidget) SelectHalfPageUp()
- func (n *NodesWidget) SelectNext()
- func (n *NodesWidget) SelectPageDown()
- func (n *NodesWidget) SelectPageUp()
- func (n *NodesWidget) SelectPrev()
- func (n *NodesWidget) SelectTop()
- func (n *NodesWidget) SelectedValues() []string
- func (n *NodesWidget) SetSortAndFilter(sortorder api.Sort, filter api.Filter)
- func (n *NodesWidget) Sortorder() api.Sort
- func (n *NodesWidget) TogglePause()
- func (n *NodesWidget) Update() error
- type PodDetailsWidget
- func (p *PodDetailsWidget) Draw(buf *ui.Buffer)
- func (p *PodDetailsWidget) Filter() api.Filter
- func (p *PodDetailsWidget) Pause() bool
- func (p *PodDetailsWidget) SelectBottom()
- func (p *PodDetailsWidget) SelectHalfPageDown()
- func (p *PodDetailsWidget) SelectHalfPageUp()
- func (p *PodDetailsWidget) SelectNext()
- func (p *PodDetailsWidget) SelectPageDown()
- func (p *PodDetailsWidget) SelectPageUp()
- func (p *PodDetailsWidget) SelectPrev()
- func (p *PodDetailsWidget) SelectTop()
- func (p *PodDetailsWidget) SelectedValues() []string
- func (p *PodDetailsWidget) SetSortAndFilter(sortorder api.Sort, filter api.Filter)
- func (p *PodDetailsWidget) Sortorder() api.Sort
- func (p *PodDetailsWidget) TogglePause()
- func (p *PodDetailsWidget) Update() error
- type PodsWidget
- func (p *PodsWidget) Filter() api.Filter
- func (p *PodsWidget) Pause() bool
- func (p *PodsWidget) SelectBottom()
- func (p *PodsWidget) SelectHalfPageDown()
- func (p *PodsWidget) SelectHalfPageUp()
- func (p *PodsWidget) SelectNext()
- func (p *PodsWidget) SelectPageDown()
- func (p *PodsWidget) SelectPageUp()
- func (p *PodsWidget) SelectPrev()
- func (p *PodsWidget) SelectTop()
- func (p *PodsWidget) SelectedValues() []string
- func (p *PodsWidget) SetSortAndFilter(sortorder api.Sort, filter api.Filter)
- func (p *PodsWidget) Sortorder() api.Sort
- func (p *PodsWidget) TogglePause()
- func (p *PodsWidget) Update() error
- type StatusbarWidget
- type Table
- func (t *Table) Draw(buf *ui.Buffer)
- func (t *Table) HandleClick(x, y int)
- func (t *Table) ScrollBottom()
- func (t *Table) ScrollDown()
- func (t *Table) ScrollHalfPageDown()
- func (t *Table) ScrollHalfPageUp()
- func (t *Table) ScrollPageDown()
- func (t *Table) ScrollPageUp()
- func (t *Table) ScrollTop()
- func (t *Table) ScrollUp()
- type View
- type ViewType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventDetailsWidget ¶ added in v1.1.0
EventDetailsWidget represents the ui widget component for the details view of an event.
func NewEventDetailsWidget ¶ added in v1.1.0
func NewEventDetailsWidget(name, namespace string, apiClient *api.Client, filter api.Filter, sortorder api.Sort, termWidth, termHeight int) *EventDetailsWidget
NewEventDetailsWidget returns an new event details widget.
func (*EventDetailsWidget) Draw ¶ added in v1.1.0
func (e *EventDetailsWidget) Draw(buf *ui.Buffer)
Draw renders our statusbar.
func (*EventDetailsWidget) Filter ¶ added in v1.1.0
func (e *EventDetailsWidget) Filter() api.Filter
Filter returns the setted filter.
func (*EventDetailsWidget) Pause ¶ added in v1.1.0
func (e *EventDetailsWidget) Pause() bool
Pause returns if updates are paused or not.
func (*EventDetailsWidget) SelectBottom ¶ added in v1.1.0
func (e *EventDetailsWidget) SelectBottom()
SelectBottom selects the bottom item in the table.
func (*EventDetailsWidget) SelectHalfPageDown ¶ added in v1.1.0
func (e *EventDetailsWidget) SelectHalfPageDown()
SelectHalfPageDown selects the item a half page down.
func (*EventDetailsWidget) SelectHalfPageUp ¶ added in v1.1.0
func (e *EventDetailsWidget) SelectHalfPageUp()
SelectHalfPageUp selects the item a half page up.
func (*EventDetailsWidget) SelectNext ¶ added in v1.1.0
func (e *EventDetailsWidget) SelectNext()
SelectNext selects the next log line.
func (*EventDetailsWidget) SelectPageDown ¶ added in v1.1.0
func (e *EventDetailsWidget) SelectPageDown()
SelectPageDown selects the item on the next page.
func (*EventDetailsWidget) SelectPageUp ¶ added in v1.1.0
func (e *EventDetailsWidget) SelectPageUp()
SelectPageUp selects the item on the previous page.
func (*EventDetailsWidget) SelectPrev ¶ added in v1.1.0
func (e *EventDetailsWidget) SelectPrev()
SelectPrev selects the previous log line.
func (*EventDetailsWidget) SelectTop ¶ added in v1.1.0
func (e *EventDetailsWidget) SelectTop()
SelectTop selects the top item in the table.
func (*EventDetailsWidget) SelectedValues ¶ added in v1.1.0
func (e *EventDetailsWidget) SelectedValues() []string
SelectedValues returns the name of the selected pod.
func (*EventDetailsWidget) SetSortAndFilter ¶ added in v1.1.0
func (e *EventDetailsWidget) SetSortAndFilter(sortorder api.Sort, filter api.Filter)
SetSortAndFilter sets a new value for the sortorder and filter.
func (*EventDetailsWidget) Sortorder ¶ added in v1.1.0
func (e *EventDetailsWidget) Sortorder() api.Sort
Sortorder returns the setted sortorder.
func (*EventDetailsWidget) TogglePause ¶ added in v1.1.0
func (e *EventDetailsWidget) TogglePause()
TogglePause sets toggle pause.
func (*EventDetailsWidget) Update ¶ added in v1.1.0
func (e *EventDetailsWidget) Update() error
Update updates the data for the details view of a pod.
type EventsWidget ¶ added in v1.1.0
type EventsWidget struct { *Table // contains filtered or unexported fields }
EventsWidget represents the ui widget component for the events view.
func NewEventsWidget ¶ added in v1.1.0
func NewEventsWidget(apiClient *api.Client, filter api.Filter, sortorder api.Sort, termWidth, termHeight int) *EventsWidget
NewEventsWidget returns a new events widget. We create the table for the events widget with all the basic layout settings.
func (*EventsWidget) Filter ¶ added in v1.1.0
func (e *EventsWidget) Filter() api.Filter
Filter returns the setted filter.
func (*EventsWidget) Pause ¶ added in v1.1.0
func (e *EventsWidget) Pause() bool
Pause returns if updates are paused or not.
func (*EventsWidget) SelectBottom ¶ added in v1.1.0
func (e *EventsWidget) SelectBottom()
SelectBottom selects the bottom item in the table.
func (*EventsWidget) SelectHalfPageDown ¶ added in v1.1.0
func (e *EventsWidget) SelectHalfPageDown()
SelectHalfPageDown selects the item a half page down.
func (*EventsWidget) SelectHalfPageUp ¶ added in v1.1.0
func (e *EventsWidget) SelectHalfPageUp()
SelectHalfPageUp selects the item a half page up.
func (*EventsWidget) SelectNext ¶ added in v1.1.0
func (e *EventsWidget) SelectNext()
SelectNext selects the next item in the table.
func (*EventsWidget) SelectPageDown ¶ added in v1.1.0
func (e *EventsWidget) SelectPageDown()
SelectPageDown selects the item on the next page.
func (*EventsWidget) SelectPageUp ¶ added in v1.1.0
func (e *EventsWidget) SelectPageUp()
SelectPageUp selects the item on the previous page.
func (*EventsWidget) SelectPrev ¶ added in v1.1.0
func (e *EventsWidget) SelectPrev()
SelectPrev selects the previous item in the table.
func (*EventsWidget) SelectTop ¶ added in v1.1.0
func (e *EventsWidget) SelectTop()
SelectTop selects the top item in the table.
func (*EventsWidget) SelectedValues ¶ added in v1.1.0
func (e *EventsWidget) SelectedValues() []string
SelectedValues returns the selected event.
func (*EventsWidget) SetSortAndFilter ¶ added in v1.1.0
func (e *EventsWidget) SetSortAndFilter(sortorder api.Sort, filter api.Filter)
SetSortAndFilter sets a new value for the sortorder and filter.
func (*EventsWidget) Sortorder ¶ added in v1.1.0
func (e *EventsWidget) Sortorder() api.Sort
Sortorder returns the setted sortorder.
func (*EventsWidget) TogglePause ¶ added in v1.1.0
func (e *EventsWidget) TogglePause()
TogglePause sets toggle pause.
func (*EventsWidget) Update ¶ added in v1.1.0
func (e *EventsWidget) Update() error
Update updates the table data of the pod view. Get the data for the pods widget and add each pod as seperate row to the table.
type ListType ¶
type ListType string
ListType is our custom type for the different list types (e.g. sort and filter)
const ( // ListTypeSort represents the the sorting list. ListTypeSort ListType = "Sort by ..." // ListTypeFilterNamespace represents the namespace filter. ListTypeFilterNamespace ListType = "Filter by Namespace ..." // ListTypeFilterNode represents the node filter. ListTypeFilterNode ListType = "Filter by Node ..." // ListTypeFilterStatus represents the status filter. ListTypeFilterStatus ListType = "Filter by Status ..." // ListTypeFilterEventType represents the event type filter. ListTypeFilterEventType ListType = "Filter by Event Type ..." // ListTypeView represents the list for switching to an other view. ListTypeView = "Select View ..." )
type ListWidget ¶
ListWidget represents the ui widget component for a list.
func NewListWidget ¶
func NewListWidget(apiClient *api.Client) *ListWidget
NewListWidget returns a new list widget.
type NodesWidget ¶
type NodesWidget struct { *Table // contains filtered or unexported fields }
NodesWidget represents the ui widget component for the nodes view.
func NewNodesWidget ¶
func NewNodesWidget(apiClient *api.Client, filter api.Filter, sortorder api.Sort, termWidth, termHeight int) *NodesWidget
NewNodesWidget returns a new nodes widget. We create the table for the nodes widget with all the basic layout settings.
func (*NodesWidget) Filter ¶
func (n *NodesWidget) Filter() api.Filter
Filter returns the setted filter.
func (*NodesWidget) Pause ¶
func (n *NodesWidget) Pause() bool
Pause returns if updates are paused or not.
func (*NodesWidget) SelectBottom ¶ added in v1.1.0
func (n *NodesWidget) SelectBottom()
SelectBottom selects the bottom item in the table.
func (*NodesWidget) SelectHalfPageDown ¶ added in v1.1.0
func (n *NodesWidget) SelectHalfPageDown()
SelectHalfPageDown selects the item a half page down.
func (*NodesWidget) SelectHalfPageUp ¶ added in v1.1.0
func (n *NodesWidget) SelectHalfPageUp()
SelectHalfPageUp selects the item a half page up.
func (*NodesWidget) SelectNext ¶
func (n *NodesWidget) SelectNext()
SelectNext selects the next item in the table.
func (*NodesWidget) SelectPageDown ¶ added in v1.1.0
func (n *NodesWidget) SelectPageDown()
SelectPageDown selects the item on the next page.
func (*NodesWidget) SelectPageUp ¶ added in v1.1.0
func (n *NodesWidget) SelectPageUp()
SelectPageUp selects the item on the previous page.
func (*NodesWidget) SelectPrev ¶
func (n *NodesWidget) SelectPrev()
SelectPrev selects the previous item in the table.
func (*NodesWidget) SelectTop ¶ added in v1.1.0
func (n *NodesWidget) SelectTop()
SelectTop selects the top item in the table.
func (*NodesWidget) SelectedValues ¶
func (n *NodesWidget) SelectedValues() []string
SelectedValues returns the name of the selected row.
func (*NodesWidget) SetSortAndFilter ¶
func (n *NodesWidget) SetSortAndFilter(sortorder api.Sort, filter api.Filter)
SetSortAndFilter sets a new value for the sortorder and filter.
func (*NodesWidget) Sortorder ¶
func (n *NodesWidget) Sortorder() api.Sort
Sortorder returns the setted sortorder.
func (*NodesWidget) TogglePause ¶
func (n *NodesWidget) TogglePause()
TogglePause sets toggle pause.
func (*NodesWidget) Update ¶
func (n *NodesWidget) Update() error
Update updates the table data of the node view. Get the data for the nodes widget and add each node as seperate row to the table.
type PodDetailsWidget ¶
PodDetailsWidget represents the ui widget component for the details view of a pod.
func NewPodDetailsWidget ¶
func NewPodDetailsWidget(name, namespace string, apiClient *api.Client, filter api.Filter, sortorder api.Sort, termWidth, termHeight int) *PodDetailsWidget
NewPodDetailsWidget returns a new pods widget. We create the table for the pods widget with all the basic layout settings.
func (*PodDetailsWidget) Draw ¶
func (p *PodDetailsWidget) Draw(buf *ui.Buffer)
Draw renders our statusbar.
func (*PodDetailsWidget) Filter ¶
func (p *PodDetailsWidget) Filter() api.Filter
Filter returns the setted filter.
func (*PodDetailsWidget) Pause ¶
func (p *PodDetailsWidget) Pause() bool
Pause returns if updates are paused or not.
func (*PodDetailsWidget) SelectBottom ¶ added in v1.1.0
func (p *PodDetailsWidget) SelectBottom()
SelectBottom selects the bottom item in the table.
func (*PodDetailsWidget) SelectHalfPageDown ¶ added in v1.1.0
func (p *PodDetailsWidget) SelectHalfPageDown()
SelectHalfPageDown selects the item a half page down.
func (*PodDetailsWidget) SelectHalfPageUp ¶ added in v1.1.0
func (p *PodDetailsWidget) SelectHalfPageUp()
SelectHalfPageUp selects the item a half page up.
func (*PodDetailsWidget) SelectNext ¶
func (p *PodDetailsWidget) SelectNext()
SelectNext selects the next log line.
func (*PodDetailsWidget) SelectPageDown ¶ added in v1.1.0
func (p *PodDetailsWidget) SelectPageDown()
SelectPageDown selects the item on the next page.
func (*PodDetailsWidget) SelectPageUp ¶ added in v1.1.0
func (p *PodDetailsWidget) SelectPageUp()
SelectPageUp selects the item on the previous page.
func (*PodDetailsWidget) SelectPrev ¶
func (p *PodDetailsWidget) SelectPrev()
SelectPrev selects the previous log line.
func (*PodDetailsWidget) SelectTop ¶ added in v1.1.0
func (p *PodDetailsWidget) SelectTop()
SelectTop selects the top item in the table.
func (*PodDetailsWidget) SelectedValues ¶
func (p *PodDetailsWidget) SelectedValues() []string
SelectedValues returns the name of the selected pod.
func (*PodDetailsWidget) SetSortAndFilter ¶
func (p *PodDetailsWidget) SetSortAndFilter(sortorder api.Sort, filter api.Filter)
SetSortAndFilter sets a new value for the sortorder and filter.
func (*PodDetailsWidget) Sortorder ¶
func (p *PodDetailsWidget) Sortorder() api.Sort
Sortorder returns the setted sortorder.
func (*PodDetailsWidget) TogglePause ¶
func (p *PodDetailsWidget) TogglePause()
TogglePause sets toggle pause.
func (*PodDetailsWidget) Update ¶
func (p *PodDetailsWidget) Update() error
Update updates the data for the details view of a pod.
type PodsWidget ¶
type PodsWidget struct { *Table // contains filtered or unexported fields }
PodsWidget represents the ui widget component for the pods view.
func NewPodsWidget ¶
func NewPodsWidget(apiClient *api.Client, filter api.Filter, sortorder api.Sort, termWidth, termHeight int) *PodsWidget
NewPodsWidget returns a new pods widget. We create the table for the pods widget with all the basic layout settings.
func (*PodsWidget) Filter ¶
func (p *PodsWidget) Filter() api.Filter
Filter returns the setted filter.
func (*PodsWidget) Pause ¶
func (p *PodsWidget) Pause() bool
Pause returns if updates are paused or not.
func (*PodsWidget) SelectBottom ¶ added in v1.1.0
func (p *PodsWidget) SelectBottom()
SelectBottom selects the bottom item in the table.
func (*PodsWidget) SelectHalfPageDown ¶ added in v1.1.0
func (p *PodsWidget) SelectHalfPageDown()
SelectHalfPageDown selects the item a half page down.
func (*PodsWidget) SelectHalfPageUp ¶ added in v1.1.0
func (p *PodsWidget) SelectHalfPageUp()
SelectHalfPageUp selects the item a half page up.
func (*PodsWidget) SelectNext ¶
func (p *PodsWidget) SelectNext()
SelectNext selects the next item in the table.
func (*PodsWidget) SelectPageDown ¶ added in v1.1.0
func (p *PodsWidget) SelectPageDown()
SelectPageDown selects the item on the next page.
func (*PodsWidget) SelectPageUp ¶ added in v1.1.0
func (p *PodsWidget) SelectPageUp()
SelectPageUp selects the item on the previous page.
func (*PodsWidget) SelectPrev ¶
func (p *PodsWidget) SelectPrev()
SelectPrev selects the previous item in the table.
func (*PodsWidget) SelectTop ¶ added in v1.1.0
func (p *PodsWidget) SelectTop()
SelectTop selects the top item in the table.
func (*PodsWidget) SelectedValues ¶
func (p *PodsWidget) SelectedValues() []string
SelectedValues returns the name of the selected pod.
func (*PodsWidget) SetSortAndFilter ¶
func (p *PodsWidget) SetSortAndFilter(sortorder api.Sort, filter api.Filter)
SetSortAndFilter sets a new value for the sortorder and filter.
func (*PodsWidget) Sortorder ¶
func (p *PodsWidget) Sortorder() api.Sort
Sortorder returns the setted sortorder.
func (*PodsWidget) Update ¶
func (p *PodsWidget) Update() error
Update updates the table data of the pod view. Get the data for the pods widget and add each pod as seperate row to the table.
type StatusbarWidget ¶
StatusbarWidget represents the ui widget component for the statusbar.
func NewStatusbarWidget ¶
func NewStatusbarWidget(apiClient *api.Client, filter api.Filter, pause bool, sortorder api.Sort, viewType ViewType, termWidth, termHeight int) *StatusbarWidget
NewStatusbarWidget returns a new statusbar widget.
func (*StatusbarWidget) Draw ¶
func (s *StatusbarWidget) Draw(buf *ui.Buffer)
Draw renders our statusbar.
func (*StatusbarWidget) SetPause ¶
func (s *StatusbarWidget) SetPause(pause bool)
SetPause sets a new value for pause.
func (*StatusbarWidget) SetSortAndFilter ¶
func (s *StatusbarWidget) SetSortAndFilter(sortorder api.Sort, filter api.Filter)
SetSortAndFilter sets a new value for the sortorder and filter.
func (*StatusbarWidget) SetViewType ¶
func (s *StatusbarWidget) SetViewType(viewType ViewType)
SetViewType sets current view type.
type Table ¶
type Table struct { *ui.Block Header []string Rows [][]string ColWidths []int ColGap int PadLeft int ShowCursor bool CursorColor ui.Color ShowLocation bool UniqueCol int SelectedItem string SelectedRow int TopRow int ColResizer func() }
Table represents our table instance. We use the table component from gotop (https://github.com/cjbassi/gotop/blob/master/src/termui/table.go). We do not use the standard table component from termui, because the component does not support scrolling.
func (*Table) ScrollBottom ¶
func (t *Table) ScrollBottom()
ScrollBottom implements scroll to bottom.
func (*Table) ScrollHalfPageDown ¶
func (t *Table) ScrollHalfPageDown()
ScrollHalfPageDown implements scroll down a half page.
func (*Table) ScrollHalfPageUp ¶
func (t *Table) ScrollHalfPageUp()
ScrollHalfPageUp implements scroll up a half page.
func (*Table) ScrollPageDown ¶
func (t *Table) ScrollPageDown()
ScrollPageDown implements scroll down a page.
func (*Table) ScrollPageUp ¶
func (t *Table) ScrollPageUp()
ScrollPageUp implements scroll up a page.
type View ¶
type View interface { ui.Drawable Filter() api.Filter Pause() bool SelectedValues() []string SelectNext() SelectPrev() SelectTop() SelectBottom() SelectHalfPageDown() SelectHalfPageUp() SelectPageDown() SelectPageUp() SetSortAndFilter(sortorder api.Sort, filter api.Filter) Sortorder() api.Sort TogglePause() Update() error }
View represents all widgets which can be rendered as seperate view.
type ViewType ¶
type ViewType string
ViewType implements all possible views for kubetop.
const ( // ViewTypeNodes represents the nodes view. // The nodes view is represented by the NodesWidget. ViewTypeNodes ViewType = "Nodes View" // ViewTypePodDetails represents the detail view for a pod. // The pod details view is represented by the PodDetailsWidget. ViewTypePodDetails ViewType = "Pod Details View" // ViewTypePods represents the pods view. // The pods view is represented by the PodsWidget. ViewTypePods ViewType = "Pods View" // ViewTypeEvents represents the events view. // The events view is represented by the EventsWidget. ViewTypeEvents ViewType = "Events View" // ViewTypeEventDetails represents the event details view. // The event details view is represented by the EventDetailsWidget. ViewTypeEventDetails ViewType = "Event Details View" )