view

package
v0.0.0-...-ecac4c4 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0, Apache-2.0 Imports: 66 Imported by: 0

Documentation

Index

Constants

View Source
const AllScopes = "all"

AllScopes represents actions available for all views.

Variables

View Source
var EOL = []byte{'\n'}

EOL tracks end of lines.

View Source
var ExitStatus = ""

ExitStatus indicates UI exit conditions.

Functions

func DismissDrain

func DismissDrain(v ResourceViewer, p *ui.Pages)

DismissDrain dismiss the port forward dialog.

func DismissPortForwards

func DismissPortForwards(v ResourceViewer, p *ui.Pages)

DismissPortForwards dismiss the port forward dialog.

func ShowDrain

func ShowDrain(view ResourceViewer, sels []string, opts dao.DrainOptions, okFn DrainFunc)

ShowDrain pops a node drain dialog.

func ShowPortForwards

func ShowPortForwards(v ResourceViewer, path string, ports port.ContainerPortSpecs, aa port.Annotations, okFn PortForwardCB)

ShowPortForwards pops a port forwarding configuration dialog.

Types

type ActionExtender

type ActionExtender interface {
	// BindKeys injects new menu actions.
	BindKeys(ResourceViewer)
}

ActionExtender enhances a given viewer by adding new menu actions.

type Alias

type Alias struct {
	ResourceViewer
}

Alias represents a command alias view.

func (*Alias) Init

func (a *Alias) Init(ctx context.Context) error

Init initializes the view.

type App

type App struct {
	*ui.App
	Content *PageStack
	// contains filtered or unexported fields
}

App represents an application view.

func NewApp

func NewApp(cfg *config.Config) *App

NewApp returns a K9s app instance.

func (*App) ActiveView

func (a *App) ActiveView() model.Component

ActiveView returns the currently active view.

func (*App) BailOut

func (a *App) BailOut()

BailOut exists the application.

func (*App) ClearStatus

func (a *App) ClearStatus(flash bool)

ClearStatus reset logo back to normal.

func (*App) ConOK

func (a *App) ConOK() bool

ConOK checks the connection is cool, returns false otherwise.

func (*App) Halt

func (a *App) Halt()

Halt stop the application event loop.

func (*App) Init

func (a *App) Init(version string, rate int) error

Init initializes the application.

func (*App) IsBenchmarking

func (a *App) IsBenchmarking() bool

IsBenchmarking check if benchmarks are active.

func (*App) PrevCmd

func (a *App) PrevCmd(evt *tcell.EventKey) *tcell.EventKey

PrevCmd pops the command stack.

func (*App) ReloadStyles

func (a *App) ReloadStyles()

ReloadStyles reloads skin file.

func (*App) Resume

func (a *App) Resume()

Resume restarts the app event loop.

func (*App) Run

func (a *App) Run() error

Run starts the application loop.

func (*App) Status

func (a *App) Status(l model.FlashLevel, msg string)

Status reports a new app status for display.

func (*App) UpdateClusterInfo

func (a *App) UpdateClusterInfo()

UpdateClusterInfo updates clusterInfo panel

type Benchmark

type Benchmark struct {
	ResourceViewer
}

Benchmark represents a service benchmark results view.

type BindKeysFunc

type BindKeysFunc func(*ui.KeyActions)

BindKeysFunc adds new menu actions.

type BoostActionsFunc

type BoostActionsFunc func(ui.KeyActions)

BoostActionsFunc extends viewer keyboard actions.

type Browser

type Browser struct {
	*Table
	// contains filtered or unexported fields
}

Browser represents a generic resource browser.

func (*Browser) Aliases

func (b *Browser) Aliases() map[string]struct{}

Aliases returns all available aliases.

func (*Browser) BufferActive

func (b *Browser) BufferActive(state bool, k model.BufferKind)

BufferActive indicates the buff activity changed.

func (*Browser) BufferChanged

func (b *Browser) BufferChanged(_, _ string)

BufferChanged indicates the buffer was changed.

func (*Browser) BufferCompleted

func (b *Browser) BufferCompleted(text, _ string)

BufferCompleted indicates input was accepted.

func (*Browser) GetTable

func (b *Browser) GetTable() *Table

GetTable returns the underlying table.

func (*Browser) InCmdMode

func (b *Browser) InCmdMode() bool

InCmdMode checks if prompt is active.

func (*Browser) Init

func (b *Browser) Init(ctx context.Context) error

Init watches all running pods in given namespace.

func (*Browser) Name

func (b *Browser) Name() string

Name returns the component name.

func (*Browser) SetContextFn

func (b *Browser) SetContextFn(f ContextFunc)

SetContextFn populates a custom context.

func (*Browser) SetFilter

func (b *Browser) SetFilter(s string)

func (*Browser) SetInstance

func (b *Browser) SetInstance(path string)

SetInstance sets a single instance view.

func (*Browser) SetLabelFilter

func (b *Browser) SetLabelFilter(labels map[string]string)

func (*Browser) Start

func (b *Browser) Start()

Start initializes browser updates.

func (*Browser) Stop

func (b *Browser) Stop()

Stop terminates browser updates.

func (*Browser) TableDataChanged

func (b *Browser) TableDataChanged(data *model1.TableData)

TableDataChanged notifies view new data is available.

func (*Browser) TableLoadFailed

func (b *Browser) TableLoadFailed(err error)

TableLoadFailed notifies view something went south.

type CRD

type CRD struct {
	ResourceViewer
}

CRD represents a crd viewer.

type ClusterInfo

type ClusterInfo struct {
	*tview.Table
	// contains filtered or unexported fields
}

ClusterInfo represents a cluster info view.

func NewClusterInfo

func NewClusterInfo(app *App) *ClusterInfo

NewClusterInfo returns a new cluster info view.

func (*ClusterInfo) ClusterInfoChanged

func (c *ClusterInfo) ClusterInfoChanged(prev, curr model.ClusterMeta)

ClusterInfoChanged notifies the cluster meta was changed.

func (*ClusterInfo) ClusterInfoUpdated

func (c *ClusterInfo) ClusterInfoUpdated(data model.ClusterMeta)

ClusterInfoUpdated notifies the cluster meta was updated.

func (*ClusterInfo) Init

func (c *ClusterInfo) Init()

Init initializes the view.

func (*ClusterInfo) StylesChanged

func (c *ClusterInfo) StylesChanged(s *config.Styles)

StylesChanged notifies skin changed.

type Command

type Command struct {
	// contains filtered or unexported fields
}

Command represents a user command.

func NewCommand

func NewCommand(app *App) *Command

NewCommand returns a new command.

func (*Command) AliasesFor

func (c *Command) AliasesFor(s string) []string

AliasesFor gather all known aliases for a given resource.

func (*Command) Init

func (c *Command) Init(path string) error

Init initializes the command.

func (*Command) Reset

func (c *Command) Reset(path string, clear bool) error

Reset resets Command and reload aliases.

type ConfigMap

type ConfigMap struct {
	ResourceViewer
}

ConfigMap represents a configmap viewer.

type Container

type Container struct {
	ResourceViewer
}

Container represents a container view.

func (*Container) Name

func (c *Container) Name() string

Name returns the component name.

type Context

type Context struct {
	ResourceViewer
}

Context presents a context viewer.

type ContextFunc

type ContextFunc func(context.Context) context.Context

ContextFunc enhances a given context.

type Cow

type Cow struct {
	*tview.TextView
	// contains filtered or unexported fields
}

Cow represents a bomb viewer.

func NewCow

func NewCow(app *App, says string) *Cow

NewCow returns a have a cow viewer.

func (*Cow) Actions

func (c *Cow) Actions() *ui.KeyActions

Actions returns menu actions.

func (*Cow) ExtraHints

func (c *Cow) ExtraHints() map[string]string

ExtraHints returns additional hints.

func (*Cow) Hints

func (c *Cow) Hints() model.MenuHints

Hints returns menu hints.

func (*Cow) InCmdMode

func (*Cow) InCmdMode() bool

InCmdMode checks if prompt is active.

func (*Cow) Init

func (c *Cow) Init(_ context.Context) error

Init initializes the viewer.

func (*Cow) Name

func (c *Cow) Name() string

Name returns the component name.

func (*Cow) Start

func (c *Cow) Start()

Start starts the view updater.

func (*Cow) Stop

func (c *Cow) Stop()

Stop terminates the updater.

func (*Cow) StylesChanged

func (c *Cow) StylesChanged(s *config.Styles)

StylesChanged notifies the skin changes.

type CronJob

type CronJob struct {
	ResourceViewer
}

CronJob represents a cronjob viewer.

type DaemonSet

type DaemonSet struct {
	ResourceViewer
}

DaemonSet represents a daemon set custom viewer.

type Deploy

type Deploy struct {
	ResourceViewer
}

Deploy represents a deployment view.

type Details

type Details struct {
	*tview.Flex
	// contains filtered or unexported fields
}

Details represents a generic text viewer.

func NewDetails

func NewDetails(app *App, title, subject, contentType string, searchable bool) *Details

NewDetails returns a details viewer.

func (*Details) Actions

func (d *Details) Actions() *ui.KeyActions

Actions returns menu actions.

func (*Details) BufferActive

func (d *Details) BufferActive(state bool, k model.BufferKind)

BufferActive indicates the buff activity changed.

func (*Details) BufferChanged

func (d *Details) BufferChanged(_, _ string)

BufferChanged indicates the buffer was changed.

func (*Details) BufferCompleted

func (d *Details) BufferCompleted(text, _ string)

BufferCompleted indicates input was accepted.

func (*Details) ExtraHints

func (d *Details) ExtraHints() map[string]string

ExtraHints returns additional hints.

func (*Details) GetWriter

func (d *Details) GetWriter() io.Writer

func (*Details) Hints

func (d *Details) Hints() model.MenuHints

Hints returns menu hints.

func (*Details) InCmdMode

func (d *Details) InCmdMode() bool

InCmdMode checks if prompt is active.

func (*Details) Init

func (d *Details) Init(_ context.Context) error

Init initializes the viewer.

func (*Details) Name

func (d *Details) Name() string

Name returns the component name.

func (*Details) SetFilter

func (d *Details) SetFilter(string)

func (*Details) SetLabelFilter

func (d *Details) SetLabelFilter(map[string]string)

func (*Details) SetSubject

func (d *Details) SetSubject(s string)

SetSubject updates the subject.

func (*Details) Start

func (d *Details) Start()

Start starts the view updater.

func (*Details) Stop

func (d *Details) Stop()

Stop terminates the updater.

func (*Details) StylesChanged

func (d *Details) StylesChanged(s *config.Styles)

StylesChanged notifies the skin changed.

func (*Details) TextChanged

func (d *Details) TextChanged(lines []string)

TextChanged notifies the model changed.

func (*Details) TextFiltered

func (d *Details) TextFiltered(lines []string, matches fuzzy.Matches)

TextFiltered notifies when the filter changed.

func (*Details) Update

func (d *Details) Update(buff string) *Details

Update updates the view content.

type Dir

type Dir struct {
	ResourceViewer
	// contains filtered or unexported fields
}

Dir represents a command directory view.

func (*Dir) Init

func (d *Dir) Init(ctx context.Context) error

Init initializes the view.

type DrainFunc

type DrainFunc func(v ResourceViewer, sels []string, opts dao.DrainOptions)

DrainFunc represents a drain callback function.

type EnterFunc

type EnterFunc func(app *App, model ui.Tabular, gvr client.GVR, path string)

EnterFunc represents an enter key action.

type Env

type Env map[string]string

Env represent K9s and K8s available environment variables.

func (Env) Substitute

func (e Env) Substitute(arg string) (string, error)

Substitute replaces env variable keys from in a string with their corresponding values.

type EnvFunc

type EnvFunc func() Env

EnvFunc represent the current view exposed environment.

type Event

type Event struct {
	ResourceViewer
}

Event represents a command alias view.

type Graphable

type Graphable interface {
	tview.Primitive

	// ID returns the graph id.
	ID() string

	// Add adds a metric
	Add(tchart.Metric)

	// SetLegend sets the graph legend
	SetLegend(string)

	// SetSeriesColors sets charts series colors.
	SetSeriesColors(...tcell.Color)

	// GetSeriesColorNames returns the series color names.
	GetSeriesColorNames() []string

	// SetFocusColorNames sets the focus color names.
	SetFocusColorNames(fg, bg string)

	// SetBackgroundColor sets chart bg color.
	SetBackgroundColor(tcell.Color)

	// IsDial returns true if chart is a dial
	IsDial() bool
}

Graphable represents a graphic component.

type Group

type Group struct {
	ResourceViewer
}

Group presents a RBAC group viewer.

type HelmChart

type HelmChart struct {
	ResourceViewer
}

HelmChart represents a helm chart view.

type Help

type Help struct {
	*Table
	// contains filtered or unexported fields
}

Help presents a help viewer.

func NewHelp

func NewHelp(app *App) *Help

NewHelp returns a new help viewer.

func (*Help) InCmdMode

func (*Help) InCmdMode() bool

InCmdMode checks if prompt is active.

func (*Help) Init

func (h *Help) Init(ctx context.Context) error

Init initializes the component.

func (*Help) SetFilter

func (h *Help) SetFilter(string)

func (*Help) SetLabelFilter

func (h *Help) SetLabelFilter(map[string]string)

func (*Help) StylesChanged

func (h *Help) StylesChanged(s *config.Styles)

StylesChanged notifies skin changed.

type HelpFunc

type HelpFunc func() model.MenuHints

HelpFunc processes menu hints.

type Hinter

type Hinter interface {
	// Hints returns a collection of hints.
	Hints() model.MenuHints
}

Hinter represents a view that can produce menu hints.

type History

type History struct {
	ResourceViewer

	Values *model.RevValues
}

History represents a helm History view.

func (*History) HistoryContext

func (h *History) HistoryContext(ctx context.Context) context.Context

func (*History) Init

func (h *History) Init(ctx context.Context) error

Init initializes the view

type ImageExtender

type ImageExtender struct {
	ResourceViewer
}

ImageExtender provides for overriding container images.

type ImageScan

type ImageScan struct {
	ResourceViewer
}

ImageScan represents an image vulnerability scan view.

func (*ImageScan) Name

func (s *ImageScan) Name() string

Name returns the component name.

type Job

type Job struct {
	ResourceViewer
}

Job represents a job viewer.

type LiveView

type LiveView struct {
	*tview.Flex
	// contains filtered or unexported fields
}

LiveView represents a live text viewer.

func NewLiveView

func NewLiveView(app *App, title string, m model.ResourceViewer) *LiveView

NewLiveView returns a live viewer.

func (*LiveView) Actions

func (v *LiveView) Actions() *ui.KeyActions

Actions returns menu actions.

func (*LiveView) BufferActive

func (v *LiveView) BufferActive(state bool, k model.BufferKind)

BufferActive indicates the buff activity changed.

func (*LiveView) BufferChanged

func (v *LiveView) BufferChanged(_, _ string)

BufferChanged indicates the buffer was changed.

func (*LiveView) BufferCompleted

func (v *LiveView) BufferCompleted(text, _ string)

BufferCompleted indicates input was accepted.

func (*LiveView) ExtraHints

func (v *LiveView) ExtraHints() map[string]string

ExtraHints returns additional hints.

func (*LiveView) Hints

func (v *LiveView) Hints() model.MenuHints

Hints returns menu hints.

func (*LiveView) InCmdMode

func (v *LiveView) InCmdMode() bool

InCmdMode checks if prompt is active.

func (*LiveView) Init

func (v *LiveView) Init(_ context.Context) error

Init initializes the viewer.

func (*LiveView) Name

func (v *LiveView) Name() string

Name returns the component name.

func (*LiveView) ResourceChanged

func (v *LiveView) ResourceChanged(lines []string, matches fuzzy.Matches)

ResourceChanged notifies when the filter changes.

func (*LiveView) ResourceFailed

func (v *LiveView) ResourceFailed(err error)

ResourceFailed notifies when their is an issue.

func (*LiveView) SetFilter

func (v *LiveView) SetFilter(string)

func (*LiveView) SetLabelFilter

func (v *LiveView) SetLabelFilter(map[string]string)

func (*LiveView) Start

func (v *LiveView) Start()

Start starts the view updater.

func (*LiveView) Stop

func (v *LiveView) Stop()

Stop terminates the updater.

func (*LiveView) StylesChanged

func (v *LiveView) StylesChanged(s *config.Styles)

StylesChanged notifies the skin changed.

type Log

type Log struct {
	*tview.Flex
	// contains filtered or unexported fields
}

Log represents a generic log viewer.

func NewLog

func NewLog(gvr client.GVR, opts *dao.LogOptions) *Log

NewLog returns a new viewer.

func (*Log) BufferActive

func (l *Log) BufferActive(state bool, k model.BufferKind)

BufferActive indicates the buff activity changed.

func (*Log) BufferChanged

func (l *Log) BufferChanged(_, _ string)

BufferChanged indicates the buffer was changed.

func (*Log) BufferCompleted

func (l *Log) BufferCompleted(text, _ string)

BufferCompleted indicates input was accepted.

func (*Log) ExtraHints

func (l *Log) ExtraHints() map[string]string

ExtraHints returns additional hints.

func (*Log) Flush

func (l *Log) Flush(lines [][]byte)

Flush write logs to viewer.

func (*Log) GetModel

func (l *Log) GetModel() *model.Log

GetModel returns the log model.

func (*Log) Hints

func (l *Log) Hints() model.MenuHints

Hints returns a collection of menu hints.

func (*Log) InCmdMode

func (l *Log) InCmdMode() bool

InCmdMode checks if prompt is active.

func (*Log) Indicator

func (l *Log) Indicator() *LogIndicator

Indicator returns the scroll mode viewer.

func (*Log) Init

func (l *Log) Init(ctx context.Context) (err error)

Init initializes the viewer.

func (*Log) LogCanceled

func (l *Log) LogCanceled()

LogCanceled indicates no more logs are coming.

func (*Log) LogChanged

func (l *Log) LogChanged(lines [][]byte)

LogChanged updates the logs.

func (*Log) LogCleared

func (l *Log) LogCleared()

LogCleared clears the logs.

func (*Log) LogFailed

func (l *Log) LogFailed(err error)

LogFailed notifies an error occurred.

func (*Log) LogResume

func (l *Log) LogResume()

LogResume resume log flushes.

func (*Log) LogStop

func (l *Log) LogStop()

LogStop disables log flushes.

func (*Log) Logs

func (l *Log) Logs() *Logger

Logs returns the log viewer.

func (*Log) Name

func (l *Log) Name() string

Name returns the component name.

func (*Log) SaveCmd

func (l *Log) SaveCmd(*tcell.EventKey) *tcell.EventKey

SaveCmd dumps the logs to file.

func (*Log) SendKeys

func (l *Log) SendKeys(kk ...tcell.Key)

SendKeys (testing only!)

func (*Log) SendStrokes

func (l *Log) SendStrokes(s string)

SendStrokes (testing only!)

func (*Log) SetFilter

func (l *Log) SetFilter(string)

func (*Log) SetLabelFilter

func (l *Log) SetLabelFilter(map[string]string)

func (*Log) Start

func (l *Log) Start()

Start runs the component.

func (*Log) Stop

func (l *Log) Stop()

Stop terminates the component.

func (*Log) StylesChanged

func (l *Log) StylesChanged(s *config.Styles)

StylesChanged reports skin changes.

type LogIndicator

type LogIndicator struct {
	*tview.TextView
	// contains filtered or unexported fields
}

LogIndicator represents a log view indicator.

func NewLogIndicator

func NewLogIndicator(cfg *config.Config, styles *config.Styles, allContainers bool) *LogIndicator

NewLogIndicator returns a new indicator.

func (*LogIndicator) AutoScroll

func (l *LogIndicator) AutoScroll() bool

AutoScroll reports the current scrolling status.

func (*LogIndicator) FullScreen

func (l *LogIndicator) FullScreen() bool

FullScreen reports the current screen mode.

func (*LogIndicator) Refresh

func (l *LogIndicator) Refresh()

Refresh updates the view.

func (*LogIndicator) StylesChanged

func (l *LogIndicator) StylesChanged(styles *config.Styles)

StylesChanged notifies listener the skin changed.

func (*LogIndicator) TextWrap

func (l *LogIndicator) TextWrap() bool

TextWrap reports the current wrap mode.

func (*LogIndicator) Timestamp

func (l *LogIndicator) Timestamp() bool

Timestamp reports the current timestamp mode.

func (*LogIndicator) ToggleAllContainers

func (l *LogIndicator) ToggleAllContainers()

ToggleAllContainers toggles the all-containers mode.

func (*LogIndicator) ToggleAutoScroll

func (l *LogIndicator) ToggleAutoScroll()

ToggleAutoScroll toggles the scroll mode.

func (*LogIndicator) ToggleFullScreen

func (l *LogIndicator) ToggleFullScreen()

ToggleFullScreen toggles the screen mode.

func (*LogIndicator) ToggleTextWrap

func (l *LogIndicator) ToggleTextWrap()

ToggleTextWrap toggles the wrap mode.

func (*LogIndicator) ToggleTimestamp

func (l *LogIndicator) ToggleTimestamp()

ToggleTimestamp toggles the current timestamp mode.

type LogOptionsFunc

type LogOptionsFunc func(bool) (*dao.LogOptions, error)

LogOptionsFunc returns the active log options.

type LogViewer

type LogViewer interface {
	ResourceViewer

	ShowLogs(prev bool)
}

LogViewer represents a log viewer.

type Logger

type Logger struct {
	*tview.TextView
	// contains filtered or unexported fields
}

Logger represents a generic log viewer.

func NewLogger

func NewLogger(app *App) *Logger

NewLogger returns a logger viewer.

func (*Logger) Actions

func (l *Logger) Actions() *ui.KeyActions

Actions returns menu actions.

func (*Logger) BufferActive

func (l *Logger) BufferActive(state bool, k model.BufferKind)

BufferActive indicates the buff activity changed.

func (*Logger) BufferChanged

func (l *Logger) BufferChanged(_, _ string)

BufferChanged indicates the buffer was changed.

func (*Logger) BufferCompleted

func (l *Logger) BufferCompleted(_, _ string)

BufferCompleted indicates input was accepted.

func (*Logger) ExtraHints

func (l *Logger) ExtraHints() map[string]string

ExtraHints returns additional hints.

func (*Logger) Hints

func (l *Logger) Hints() model.MenuHints

Hints returns menu hints.

func (*Logger) Init

func (l *Logger) Init(_ context.Context) error

Init initializes the viewer.

func (*Logger) Name

func (l *Logger) Name() string

Name returns the component name.

func (*Logger) SetSubject

func (l *Logger) SetSubject(s string)

SetSubject updates the subject.

func (*Logger) Start

func (l *Logger) Start()

Start starts the view updater.

func (*Logger) Stop

func (l *Logger) Stop()

Stop terminates the updater.

func (*Logger) StylesChanged

func (l *Logger) StylesChanged(s *config.Styles)

StylesChanged notifies the skin changed.

type LogsExtender

type LogsExtender struct {
	ResourceViewer
	// contains filtered or unexported fields
}

LogsExtender adds log actions to a given viewer.

type MetaViewer

type MetaViewer struct {
	// contains filtered or unexported fields
}

MetaViewer represents a registered meta viewer.

type MetaViewers

type MetaViewers map[client.GVR]MetaViewer

MetaViewers represents a collection of meta viewers.

type Namespace

type Namespace struct {
	ResourceViewer
}

Namespace represents a namespace viewer.

type Node

type Node struct {
	ResourceViewer
}

Node represents a node view.

type OwnerExtender

type OwnerExtender struct {
	ResourceViewer
}

OwnerExtender adds owner actions to a given viewer.

type PageStack

type PageStack struct {
	*ui.Pages
	// contains filtered or unexported fields
}

PageStack represents a stack of pages.

func NewPageStack

func NewPageStack() *PageStack

NewPageStack returns a new page stack.

func (*PageStack) Init

func (p *PageStack) Init(ctx context.Context) (err error)

Init initializes the view.

func (*PageStack) StackPopped

func (p *PageStack) StackPopped(o, top model.Component)

StackPopped notifies a page was removed.

func (*PageStack) StackPushed

func (p *PageStack) StackPushed(c model.Component)

StackPushed notifies a new page was added.

func (*PageStack) StackTop

func (p *PageStack) StackTop(top model.Component)

StackTop notifies for the top component.

type PersistentVolumeClaim

type PersistentVolumeClaim struct {
	ResourceViewer
}

PersistentVolumeClaim represents a PVC custom viewer.

type Picker

type Picker struct {
	*tview.List
	// contains filtered or unexported fields
}

Picker represents a container picker.

func NewPicker

func NewPicker() *Picker

NewPicker returns a new picker.

func (*Picker) ExtraHints

func (p *Picker) ExtraHints() map[string]string

ExtraHints returns additional hints.

func (*Picker) Hints

func (p *Picker) Hints() model.MenuHints

Hints returns the view hints.

func (*Picker) InCmdMode

func (*Picker) InCmdMode() bool

InCmdMode checks if prompt is active.

func (*Picker) Init

func (p *Picker) Init(ctx context.Context) error

Init initializes the view.

func (*Picker) Name

func (p *Picker) Name() string

Name returns the component name.

func (*Picker) SetFilter

func (p *Picker) SetFilter(string)

func (*Picker) SetLabelFilter

func (p *Picker) SetLabelFilter(map[string]string)

func (*Picker) Start

func (p *Picker) Start()

Start starts the view.

func (*Picker) Stop

func (p *Picker) Stop()

Stop stops the view.

type Pod

type Pod struct {
	ResourceViewer
}

Pod represents a pod viewer.

type Policy

type Policy struct {
	ResourceViewer
	// contains filtered or unexported fields
}

Policy presents a RBAC rules viewer based on what a given user/group or sa can do.

func NewPolicy

func NewPolicy(app *App, subject, name string) *Policy

NewPolicy returns a new viewer.

type PortForward

type PortForward struct {
	ResourceViewer
	// contains filtered or unexported fields
}

PortForward presents active portforward viewer.

type PortForwardCB

type PortForwardCB func(ResourceViewer, string, port.PortTunnels) error

PortForwardCB represents a port-forward callback function.

type PortForwardExtender

type PortForwardExtender struct {
	ResourceViewer
}

PortForwardExtender adds port-forward extensions.

type PriorityClass

type PriorityClass struct {
	ResourceViewer
}

PriorityClass presents a priority class viewer.

type Pulse

type Pulse struct {
	*tview.Grid
	// contains filtered or unexported fields
}

Pulse represents a command health view.

func (*Pulse) Actions

func (p *Pulse) Actions() *ui.KeyActions

Actions returns active menu bindings.

func (*Pulse) AddBindKeysFn

func (p *Pulse) AddBindKeysFn(BindKeysFunc)

AddBindKeysFn sets up extra key bindings.

func (*Pulse) App

func (p *Pulse) App() *App

App returns the current app handle.

func (*Pulse) ExtraHints

func (p *Pulse) ExtraHints() map[string]string

ExtraHints returns additional hints.

func (*Pulse) GVR

func (p *Pulse) GVR() client.GVR

GVR returns a resource descriptor.

func (*Pulse) GetTable

func (p *Pulse) GetTable() *Table

GetTable return the view table if any.

func (*Pulse) Hints

func (p *Pulse) Hints() model.MenuHints

Hints returns the view hints.

func (*Pulse) InCmdMode

func (*Pulse) InCmdMode() bool

InCmdMode checks if prompt is active.

func (*Pulse) Init

func (p *Pulse) Init(ctx context.Context) error

Init initializes the view.

func (*Pulse) Name

func (p *Pulse) Name() string

Name returns the component name.

func (*Pulse) PulseChanged

func (p *Pulse) PulseChanged(c *health.Check)

PulseChanged notifies the model data changed.

func (*Pulse) PulseFailed

func (p *Pulse) PulseFailed(err error)

PulseFailed notifies the load failed.

func (*Pulse) Refresh

func (p *Pulse) Refresh()

Refresh updates the view.

func (*Pulse) SetContextFn

func (p *Pulse) SetContextFn(ContextFunc)

SetContextFn sets custom context.

func (*Pulse) SetEnvFn

func (p *Pulse) SetEnvFn(EnvFunc)

SetEnvFn sets the custom environment function.

func (*Pulse) SetFilter

func (p *Pulse) SetFilter(string)

func (*Pulse) SetInstance

func (p *Pulse) SetInstance(string)

SetInstance sets specific resource instance.

func (*Pulse) SetLabelFilter

func (p *Pulse) SetLabelFilter(map[string]string)

func (*Pulse) Start

func (p *Pulse) Start()

Start initializes resource watch loop.

func (*Pulse) Stop

func (p *Pulse) Stop()

Stop terminates watch loop.

func (*Pulse) StylesChanged

func (p *Pulse) StylesChanged(s *config.Styles)

StylesChanged notifies the skin changed.

type Rbac

type Rbac struct {
	ResourceViewer
}

Rbac presents an RBAC policy viewer.

type Reference

type Reference struct {
	ResourceViewer
}

Reference represents resource references.

func (*Reference) Init

func (r *Reference) Init(ctx context.Context) error

Init initializes the view.

type ReplicaSet

type ReplicaSet struct {
	ResourceViewer
}

ReplicaSet presents a replicaset viewer.

type ResourceViewer

type ResourceViewer interface {
	TableViewer

	// SetEnvFn sets a function to pull viewer env vars for plugins.
	SetEnvFn(EnvFunc)

	// GVR returns a resource descriptor.
	GVR() client.GVR

	// SetContextFn provision a custom context.
	SetContextFn(ContextFunc)

	// AddBindKeysFn provision additional key bindings.
	AddBindKeysFn(BindKeysFunc)

	// SetInstance sets a parent FQN
	SetInstance(string)
}

ResourceViewer represents a generic resource viewer.

func NewAlias

func NewAlias(gvr client.GVR) ResourceViewer

NewAlias returns a new alias view.

func NewBenchmark

func NewBenchmark(gvr client.GVR) ResourceViewer

NewBenchmark returns a new viewer.

func NewBrowser

func NewBrowser(gvr client.GVR) ResourceViewer

NewBrowser returns a new browser.

func NewCRD

func NewCRD(gvr client.GVR) ResourceViewer

NewCRD returns a new viewer.

func NewConfigMap

func NewConfigMap(gvr client.GVR) ResourceViewer

NewConfigMap returns a new viewer.

func NewContainer

func NewContainer(gvr client.GVR) ResourceViewer

NewContainer returns a new container view.

func NewContext

func NewContext(gvr client.GVR) ResourceViewer

NewContext returns a new viewer.

func NewCronJob

func NewCronJob(gvr client.GVR) ResourceViewer

NewCronJob returns a new viewer.

func NewDaemonSet

func NewDaemonSet(gvr client.GVR) ResourceViewer

NewDaemonSet returns a new viewer.

func NewDeploy

func NewDeploy(gvr client.GVR) ResourceViewer

NewDeploy returns a new deployment view.

func NewDir

func NewDir(path string) ResourceViewer

NewDir returns a new instance.

func NewEvent

func NewEvent(gvr client.GVR) ResourceViewer

NewEvent returns a new alias view.

func NewGroup

func NewGroup(gvr client.GVR) ResourceViewer

NewGroup returns a new subject viewer.

func NewHelmChart

func NewHelmChart(gvr client.GVR) ResourceViewer

NewHelmChart returns a new helm-chart view.

func NewHistory

func NewHistory(gvr client.GVR) ResourceViewer

NewHistory returns a new helm-history view.

func NewImageExtender

func NewImageExtender(r ResourceViewer) ResourceViewer

NewImageExtender returns a new extender.

func NewImageScan

func NewImageScan(gvr client.GVR) ResourceViewer

NewImageScan returns a new scans view.

func NewJob

func NewJob(gvr client.GVR) ResourceViewer

NewJob returns a new viewer.

func NewLogsExtender

func NewLogsExtender(v ResourceViewer, f LogOptionsFunc) ResourceViewer

NewLogsExtender returns a new extender.

func NewNamespace

func NewNamespace(gvr client.GVR) ResourceViewer

NewNamespace returns a new viewer.

func NewNode

func NewNode(gvr client.GVR) ResourceViewer

NewNode returns a new node view.

func NewOwnerExtender

func NewOwnerExtender(r ResourceViewer) ResourceViewer

NewOwnerExtender returns a new extender.

func NewPersistentVolumeClaim

func NewPersistentVolumeClaim(gvr client.GVR) ResourceViewer

NewPersistentVolumeClaim returns a new viewer.

func NewPod

func NewPod(gvr client.GVR) ResourceViewer

NewPod returns a new viewer.

func NewPortForward

func NewPortForward(gvr client.GVR) ResourceViewer

NewPortForward returns a new viewer.

func NewPortForwardExtender

func NewPortForwardExtender(r ResourceViewer) ResourceViewer

NewPortForwardExtender returns a new extender.

func NewPriorityClass

func NewPriorityClass(gvr client.GVR) ResourceViewer

NewPriorityClass returns a new viewer.

func NewPulse

func NewPulse(gvr client.GVR) ResourceViewer

NewPulse returns a new alias view.

func NewRbac

func NewRbac(gvr client.GVR) ResourceViewer

NewRbac returns a new viewer.

func NewReference

func NewReference(gvr client.GVR) ResourceViewer

NewReference returns a new alias view.

func NewReplicaSet

func NewReplicaSet(gvr client.GVR) ResourceViewer

NewReplicaSet returns a new viewer.

func NewRestartExtender

func NewRestartExtender(v ResourceViewer) ResourceViewer

NewRestartExtender returns a new extender.

func NewSanitizer

func NewSanitizer(gvr client.GVR) ResourceViewer

NewSanitizer returns a new view.

func NewScaleExtender

func NewScaleExtender(r ResourceViewer) ResourceViewer

NewScaleExtender returns a new extender.

func NewScreenDump

func NewScreenDump(gvr client.GVR) ResourceViewer

NewScreenDump returns a new viewer.

func NewSecret

func NewSecret(gvr client.GVR) ResourceViewer

NewSecret returns a new viewer.

func NewService

func NewService(gvr client.GVR) ResourceViewer

NewService returns a new viewer.

func NewServiceAccount

func NewServiceAccount(gvr client.GVR) ResourceViewer

NewServiceAccount returns a new viewer.

func NewStatefulSet

func NewStatefulSet(gvr client.GVR) ResourceViewer

NewStatefulSet returns a new viewer.

func NewUser

func NewUser(gvr client.GVR) ResourceViewer

NewUser returns a new subject viewer.

func NewValueExtender

func NewValueExtender(r ResourceViewer) ResourceViewer

NewValueExtender returns a new extender.

func NewVulnerabilityExtender

func NewVulnerabilityExtender(r ResourceViewer) ResourceViewer

NewVulnerabilityExtender returns a new extender.

func NewWorkload

func NewWorkload(gvr client.GVR) ResourceViewer

NewWorkload returns a new viewer.

func NewXray

func NewXray(gvr client.GVR) ResourceViewer

NewXray returns a new view.

type RestartExtender

type RestartExtender struct {
	ResourceViewer
}

RestartExtender represents a restartable resource.

type RestartableViewer

type RestartableViewer interface {
	LogViewer
}

RestartableViewer represents a viewer with restartable resources.

type Runner

type Runner interface {
	App() *App
	GetSelectedItem() string
	Aliases() map[string]struct{}
	EnvFn() EnvFunc
}

Runner represents a runnable action handler.

type Sanitizer

type Sanitizer struct {
	*ui.Tree
	// contains filtered or unexported fields
}

Sanitizer represents a sanitizer tree view.

func (*Sanitizer) AddBindKeysFn

func (s *Sanitizer) AddBindKeysFn(BindKeysFunc)

AddBindKeysFn sets up extra key bindings.

func (*Sanitizer) Aliases

func (s *Sanitizer) Aliases() []string

Aliases returns all available aliases.

func (*Sanitizer) App

func (s *Sanitizer) App() *App

App returns the current app handle.

func (*Sanitizer) BufferActive

func (s *Sanitizer) BufferActive(state bool, k model.BufferKind)

BufferActive indicates the buff activity changed.

func (*Sanitizer) BufferChanged

func (s *Sanitizer) BufferChanged(_, _ string)

BufferChanged indicates the buffer was changed.

func (*Sanitizer) BufferCompleted

func (s *Sanitizer) BufferCompleted(_, _ string)

BufferCompleted indicates input was accepted.

func (*Sanitizer) EnvFn

func (s *Sanitizer) EnvFn() EnvFunc

EnvFn returns an plugin env function if available.

func (*Sanitizer) ExtraHints

func (s *Sanitizer) ExtraHints() map[string]string

ExtraHints returns additional hints.

func (*Sanitizer) GVR

func (s *Sanitizer) GVR() client.GVR

GVR returns a resource descriptor.

func (*Sanitizer) GetSelectedPath

func (s *Sanitizer) GetSelectedPath() string

GetSelectedPath returns the current selection as string.

func (*Sanitizer) GetTable

func (s *Sanitizer) GetTable() *Table

GetTable returns the underlying table.

func (*Sanitizer) InCmdMode

func (*Sanitizer) InCmdMode() bool

InCmdMode checks if prompt is active.

func (*Sanitizer) Init

func (s *Sanitizer) Init(ctx context.Context) error

Init initializes the view.

func (*Sanitizer) Name

func (s *Sanitizer) Name() string

Name returns the component name.

func (*Sanitizer) Refresh

func (s *Sanitizer) Refresh()

Refresh updates the view.

func (*Sanitizer) SetContextFn

func (s *Sanitizer) SetContextFn(f ContextFunc)

SetContextFn sets custom context.

func (*Sanitizer) SetEnvFn

func (s *Sanitizer) SetEnvFn(EnvFunc)

SetEnvFn sets the custom environment function.

func (*Sanitizer) SetFilter

func (s *Sanitizer) SetFilter(string)

func (*Sanitizer) SetInstance

func (s *Sanitizer) SetInstance(string)

SetInstance sets specific resource instance.

func (*Sanitizer) SetLabelFilter

func (s *Sanitizer) SetLabelFilter(map[string]string)

func (*Sanitizer) Start

func (s *Sanitizer) Start()

Start initializes resource watch loop.

func (*Sanitizer) Stop

func (s *Sanitizer) Stop()

Stop terminates watch loop.

func (*Sanitizer) TreeChanged

func (s *Sanitizer) TreeChanged(node *xray.TreeNode)

TreeChanged notifies the model data changed.

func (*Sanitizer) TreeLoadFailed

func (s *Sanitizer) TreeLoadFailed(err error)

TreeLoadFailed notifies the load failed.

func (*Sanitizer) TreeNodeSelected

func (s *Sanitizer) TreeNodeSelected()

TreeNodeSelected callback for node selection.

func (*Sanitizer) UpdateTitle

func (s *Sanitizer) UpdateTitle()

UpdateTitle updates the view title.

type ScalableViewer

type ScalableViewer interface {
	LogViewer
}

ScalableViewer represents a viewer with scalable resources.

type ScaleExtender

type ScaleExtender struct {
	ResourceViewer
}

ScaleExtender adds scaling extensions.

type ScreenDump

type ScreenDump struct {
	ResourceViewer
}

ScreenDump presents a directory listing viewer.

type Secret

type Secret struct {
	ResourceViewer
}

Secret presents a secret viewer.

type Service

type Service struct {
	ResourceViewer
	// contains filtered or unexported fields
}

Service represents a service viewer.

type ServiceAccount

type ServiceAccount struct {
	ResourceViewer
}

ServiceAccount represents a serviceaccount viewer.

type StatefulSet

type StatefulSet struct {
	ResourceViewer
}

StatefulSet represents a statefulset viewer.

type SubjectViewer

type SubjectViewer interface {
	ResourceViewer

	// SetSubject sets the active subject.
	SetSubject(s string)
}

SubjectViewer represents a policy viewer.

type Table

type Table struct {
	*ui.Table
	// contains filtered or unexported fields
}

Table represents a table viewer.

func NewTable

func NewTable(gvr client.GVR) *Table

NewTable returns a new viewer.

func (*Table) AddBindKeysFn

func (t *Table) AddBindKeysFn(f BindKeysFunc)

AddBindKeysFn adds additional key bindings.

func (*Table) App

func (t *Table) App() *App

App returns the current app handle.

func (*Table) BufferActive

func (t *Table) BufferActive(state bool, k model.BufferKind)

BufferActive indicates the buff activity changed.

func (*Table) BufferChanged

func (t *Table) BufferChanged(_, _ string)

BufferChanged indicates the buffer was changed.

func (*Table) BufferCompleted

func (t *Table) BufferCompleted(text, _ string)

BufferCompleted indicates input was accepted.

func (*Table) EnvFn

func (t *Table) EnvFn() EnvFunc

EnvFn returns an plugin env function if available.

func (*Table) HeaderIndex

func (t *Table) HeaderIndex(colName string) (int, bool)

HeaderIndex returns index of a given column or false if not found.

func (*Table) Init

func (t *Table) Init(ctx context.Context) (err error)

Init initializes the component.

func (*Table) Name

func (t *Table) Name() string

Name returns the table name.

func (*Table) SendKey

func (t *Table) SendKey(evt *tcell.EventKey)

SendKey sends an keyboard event (testing only!).

func (*Table) SetEnterFn

func (t *Table) SetEnterFn(f EnterFunc)

SetEnterFn specifies the default enter behavior.

func (*Table) SetEnvFn

func (t *Table) SetEnvFn(f EnvFunc)

SetEnvFn sets a function to pull viewer env vars for plugins.

func (*Table) SetExtraActionsFn

func (t *Table) SetExtraActionsFn(BoostActionsFunc)

SetExtraActionsFn specifies custom keyboard behavior.

func (*Table) Start

func (t *Table) Start()

Start runs the component.

func (*Table) Stop

func (t *Table) Stop()

Stop terminates the component.

type TableViewer

type TableViewer interface {
	Viewer

	// GetTable returns a table component.
	GetTable() *Table
}

TableViewer represents a tabular viewer.

type User

type User struct {
	ResourceViewer
}

User presents a user viewer.

type ValueExtender

type ValueExtender struct {
	ResourceViewer
}

ValueExtender adds values actions to a given viewer.

type Viewer

type Viewer interface {
	model.Component

	// Actions returns active menu bindings.
	Actions() *ui.KeyActions

	// App returns an app handle.
	App() *App

	// Refresh updates the viewer
	Refresh()
}

Viewer represents a component viewer.

type ViewerFunc

type ViewerFunc func(client.GVR) ResourceViewer

ViewerFunc returns a viewer matching a given gvr.

type VulnerabilityExtender

type VulnerabilityExtender struct {
	ResourceViewer
}

VulnerabilityExtender adds vul image scan extensions.

type Workload

type Workload struct {
	ResourceViewer
}

Workload presents a workload viewer.

type Xray

type Xray struct {
	*ui.Tree
	// contains filtered or unexported fields
}

Xray represents an xray tree view.

func (*Xray) AddBindKeysFn

func (x *Xray) AddBindKeysFn(BindKeysFunc)

AddBindKeysFn sets up extra key bindings.

func (*Xray) Aliases

func (x *Xray) Aliases() map[string]struct{}

Aliases returns all available aliases.

func (*Xray) App

func (x *Xray) App() *App

App returns the current app handle.

func (*Xray) BufferActive

func (x *Xray) BufferActive(state bool, k model.BufferKind)

BufferActive indicates the buff activity changed.

func (*Xray) BufferChanged

func (x *Xray) BufferChanged(_, _ string)

BufferChanged indicates the buffer was changed.

func (*Xray) BufferCompleted

func (x *Xray) BufferCompleted(_, _ string)

BufferCompleted indicates the buffer was changed.

func (*Xray) EnvFn

func (x *Xray) EnvFn() EnvFunc

EnvFn returns an plugin env function if available.

func (*Xray) ExtraHints

func (x *Xray) ExtraHints() map[string]string

ExtraHints returns additional hints.

func (*Xray) GVR

func (x *Xray) GVR() client.GVR

GVR returns a resource descriptor.

func (*Xray) GetSelectedPath

func (x *Xray) GetSelectedPath() string

GetSelectedPath returns the current selection as string.

func (*Xray) GetTable

func (x *Xray) GetTable() *Table

GetTable returns the underlying table.

func (*Xray) InCmdMode

func (*Xray) InCmdMode() bool

InCmdMode checks if prompt is active.

func (*Xray) Init

func (x *Xray) Init(ctx context.Context) error

Init initializes the view.

func (*Xray) Name

func (x *Xray) Name() string

Name returns the component name.

func (*Xray) Refresh

func (x *Xray) Refresh()

Refresh updates the view.

func (*Xray) SetContextFn

func (x *Xray) SetContextFn(ContextFunc)

SetContextFn sets custom context.

func (*Xray) SetEnvFn

func (x *Xray) SetEnvFn(EnvFunc)

SetEnvFn sets the custom environment function.

func (*Xray) SetFilter

func (x *Xray) SetFilter(string)

func (*Xray) SetInstance

func (x *Xray) SetInstance(string)

SetInstance sets specific resource instance.

func (*Xray) SetLabelFilter

func (x *Xray) SetLabelFilter(map[string]string)

func (*Xray) Start

func (x *Xray) Start()

Start initializes resource watch loop.

func (*Xray) Stop

func (x *Xray) Stop()

Stop terminates watch loop.

func (*Xray) TreeChanged

func (x *Xray) TreeChanged(node *xray.TreeNode)

TreeChanged notifies the model data changed.

func (*Xray) TreeLoadFailed

func (x *Xray) TreeLoadFailed(err error)

TreeLoadFailed notifies the load failed.

func (*Xray) TreeNodeSelected

func (x *Xray) TreeNodeSelected()

TreeNodeSelected callback for node selection.

func (*Xray) UpdateTitle

func (x *Xray) UpdateTitle()

UpdateTitle updates the view title.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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