ui

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventListener

type EventListener interface {
	// OnQuit is invoked on the quit is required
	OnQuit()

	// OnPodSelected is invoked when the selected pod is changed
	OnPodSelected(name string, index int)

	// OnContainerSelected is invoked when the selected container is changed
	OnContainerSelected(name string, index int)
}

EventListener is a listener interface for UI events

type Mode

type Mode int

Mode represents a mode on UI

const (
	ModeNormal    Mode = iota // Normal mode
	ModeFollow                // Follow mode
	ModeInputFind             // Input find mode
)

UI mode

type StatusBar

type StatusBar struct {
	views.BoxLayout
	// contains filtered or unexported fields
}

StatusBar is a status bar on the bottom of the UI

func NewStatusBar

func NewStatusBar() *StatusBar

NewStatusBar returns a new status bar

func (*StatusBar) SetContext

func (w *StatusBar) SetContext(cluster, namespace string)

SetContext sets current kubeconfig context (cluster name and namespace) on the status bar

func (*StatusBar) SetMode

func (w *StatusBar) SetMode(mode Mode)

SetMode sets current mode on the status bar

func (*StatusBar) SetPodCount

func (w *StatusBar) SetPodCount(count int)

SetPodCount sets the count of the pods

func (*StatusBar) SetScroll

func (w *StatusBar) SetScroll(percent int)

SetScroll sets the percent of the scroll

type UI

type UI struct {
	views.BoxLayout
	// contains filtered or unexported fields
}

UI is an user interface for the logbook

func NewUI

func NewUI() *UI

NewUI returns new UI

func (*UI) AddContainer

func (ui *UI) AddContainer(name string)

AddContainer adds container by the name into the tabs

func (*UI) AddPagerText

func (ui *UI) AddPagerText(line string)

AddPagerText adds text line into the pager

func (*UI) AddPod

func (ui *UI) AddPod(name string, status types.PodStatus)

AddPod adds a pod by the name and its status to the list view.

func (*UI) ClearContainers

func (ui *UI) ClearContainers()

ClearContainers clears containers in the tabs

func (*UI) ClearPager

func (ui *UI) ClearPager()

ClearPager clears the pager

func (*UI) DeletePod

func (ui *UI) DeletePod(name string)

DeletePod deletes pod by the name on the list view.

func (*UI) DisableFollowMode

func (ui *UI) DisableFollowMode()

DisableFollowMode disables follow mode on the pager

func (*UI) EnableFollowMode

func (ui *UI) EnableFollowMode()

EnableFollowMode enabled follow mode on the pager

func (*UI) HandleEvent

func (ui *UI) HandleEvent(ev tcell.Event) bool

HandleEvent handles events on tcell

func (*UI) SelectContainerAt

func (ui *UI) SelectContainerAt(index int)

SelectContainerAt selects a container by the index

func (*UI) SelectPodAt

func (ui *UI) SelectPodAt(index int)

SelectPodAt selects a pod by the index

func (*UI) SetContext

func (ui *UI) SetContext(cluster, namespace string)

SetContext sets kubenetes context (the cluster name and the namespace)

func (*UI) SetPodStatus

func (ui *UI) SetPodStatus(name string, status types.PodStatus)

SetPodStatus updates the pod status by name to the status

func (*UI) SetStatusMode

func (ui *UI) SetStatusMode(mode Mode)

SetStatusMode sets the mode in the status bar

func (*UI) WatchUIEvents

func (ui *UI) WatchUIEvents(l EventListener)

WatchUIEvents registers an EventListener for the UI

Jump to

Keyboard shortcuts

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