view

package
v0.25.16 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2021 License: Apache-2.0, Apache-2.0 Imports: 55 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 added in v0.17.6

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

DismissDrain dismiss the port forward dialog.

func DismissPortForwards added in v0.15.2

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

DismissPortForwards dismiss the port forward dialog.

func ShowDrain added in v0.17.6

func ShowDrain(view ResourceViewer, path string, defaults dao.DrainOptions, okFn DrainFunc)

ShowDrain pops a node drain dialog.

func ShowPortForwards added in v0.15.2

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 added in v0.16.0

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 added in v0.13.5

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 added in v0.17.6

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) 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.

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() []string

Aliases returns all available aliases.

func (*Browser) BufferActive added in v0.19.3

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

BufferActive indicates the buff activity changed.

func (*Browser) BufferChanged added in v0.19.3

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

BufferChanged indicates the buffer was changed.

func (*Browser) BufferCompleted added in v0.23.0

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 added in v0.24.11

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) SetInstance

func (b *Browser) SetInstance(path string)

SetInstance sets a single instance view.

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 render.TableData)

TableDataChanged notifies view new data is available.

func (*Browser) TableLoadFailed

func (b *Browser) TableLoadFailed(err error)

TableLoadFailed notifies view something went south.

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 added in v0.13.5

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

ClusterInfoChanged notifies the cluster meta was changed.

func (*ClusterInfo) ClusterInfoUpdated added in v0.13.5

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) Init

func (c *Command) Init() error

Init initializes the command.

func (*Command) Reset

func (c *Command) Reset(clear bool) error

Reset resets Command and reload aliases.

type ConfigMap added in v0.20.0

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 added in v0.23.0

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

Cow represents a bomb viewer.

func NewCow added in v0.23.0

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

NewCow returns a have a cow viewer.

func (*Cow) Actions added in v0.23.0

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

Actions returns menu actions.

func (*Cow) ExtraHints added in v0.23.0

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

ExtraHints returns additional hints.

func (*Cow) Hints added in v0.23.0

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

Hints returns menu hints.

func (*Cow) InCmdMode added in v0.24.11

func (*Cow) InCmdMode() bool

InCmdMode checks if prompt is active.

func (*Cow) Init added in v0.23.0

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

Init initializes the viewer.

func (*Cow) Name added in v0.23.0

func (c *Cow) Name() string

Name returns the component name.

func (*Cow) Start added in v0.23.0

func (c *Cow) Start()

Start starts the view updater.

func (*Cow) Stop added in v0.23.0

func (c *Cow) Stop()

Stop terminates the updater.

func (*Cow) StylesChanged added in v0.23.0

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 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 added in v0.14.0

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

BufferActive indicates the buff activity changed.

func (*Details) BufferChanged added in v0.14.0

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

BufferChanged indicates the buffer was changed.

func (*Details) BufferCompleted added in v0.23.0

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

BufferCompleted indicates input was accepted.

func (*Details) ExtraHints added in v0.13.3

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

ExtraHints returns additional hints.

func (*Details) Hints

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

Hints returns menu hints.

func (*Details) InCmdMode added in v0.24.11

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) 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 added in v0.14.0

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

TextChanged notifies the model changed.

func (*Details) TextFiltered added in v0.14.0

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 added in v0.21.0

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

Dir represents a command directory view.

func (*Dir) Init added in v0.21.0

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

Init initializes the view.

type DrainFunc added in v0.17.6

type DrainFunc func(v ResourceViewer, path string, opts dao.DrainOptions)

DrainFunc represents a drain callback function.

type EnterFunc

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

EnterFunc represents an enter key action.

type Env added in v0.17.7

type Env map[string]string

Env represent K9s and K8s available environment variables.

func (Env) Substitute added in v0.17.7

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 added in v0.24.8

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 Helm added in v0.19.3

type Helm struct {
	ResourceViewer
}

Helm 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 added in v0.24.11

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) StylesChanged added in v0.24.9

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 ImageExtender added in v0.23.0

type ImageExtender struct {
	ResourceViewer
}

ImageExtender provides for overriding container images.

type Job

type Job struct {
	ResourceViewer
}

Job represents a job viewer.

type LiveView added in v0.23.0

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

LiveView represents a live text viewer.

func NewLiveView added in v0.23.0

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

NewLiveView returns a live viewer.

func (*LiveView) Actions added in v0.23.0

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

Actions returns menu actions.

func (*LiveView) BufferActive added in v0.23.0

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

BufferActive indicates the buff activity changed.

func (*LiveView) BufferChanged added in v0.23.0

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

BufferChanged indicates the buffer was changed.

func (*LiveView) BufferCompleted added in v0.23.0

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

BufferCompleted indicates input was accepted.

func (*LiveView) ExtraHints added in v0.23.0

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

ExtraHints returns additional hints.

func (*LiveView) Hints added in v0.23.0

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

Hints returns menu hints.

func (*LiveView) InCmdMode added in v0.24.11

func (v *LiveView) InCmdMode() bool

InCmdMode checks if prompt is active.

func (*LiveView) Init added in v0.23.0

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

Init initializes the viewer.

func (*LiveView) Name added in v0.23.0

func (v *LiveView) Name() string

Name returns the component name.

func (*LiveView) ResourceChanged added in v0.23.0

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

ResourceChanged notifies when the filter changes.

func (*LiveView) ResourceFailed added in v0.23.0

func (v *LiveView) ResourceFailed(err error)

ResourceFailed notifies when their is an issue.

func (*LiveView) Start added in v0.23.0

func (v *LiveView) Start()

Start starts the view updater.

func (*LiveView) Stop added in v0.23.0

func (v *LiveView) Stop()

Stop terminates the updater.

func (*LiveView) StylesChanged added in v0.23.0

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 added in v0.23.0

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

BufferCompleted indicates input was accepted.

func (*Log) ExtraHints added in v0.13.3

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 added in v0.24.11

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 added in v0.25.0

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 added in v0.25.0

func (l *Log) LogResume()

LogResume resume log flushes.

func (*Log) LogStop added in v0.25.0

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 added in v0.18.0

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

SendKeys (testing only!)

func (*Log) SendStrokes added in v0.18.0

func (l *Log) SendStrokes(s string)

SendStrokes (testing only!)

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 added in v0.18.0

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 added in v0.17.1

func (l *LogIndicator) Timestamp() bool

Timestamp reports the current timestamp mode.

func (*LogIndicator) ToggleAllContainers added in v0.24.11

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 added in v0.17.1

func (l *LogIndicator) ToggleTimestamp()

ToggleTimestamp toggles the current timestamp mode.

type LogOptionsFunc added in v0.24.11

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 added in v0.23.0

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

Logger represents a generic log viewer.

func NewLogger added in v0.23.0

func NewLogger(app *App) *Logger

NewLogger returns a logger viewer.

func (*Logger) Actions added in v0.23.0

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

Actions returns menu actions.

func (*Logger) BufferActive added in v0.23.0

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

BufferActive indicates the buff activity changed.

func (*Logger) BufferChanged added in v0.23.0

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

BufferChanged indicates the buffer was changed.

func (*Logger) BufferCompleted added in v0.23.0

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

BufferCompleted indicates input was accepted.

func (*Logger) ExtraHints added in v0.23.0

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

ExtraHints returns additional hints.

func (*Logger) Hints added in v0.23.0

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

Hints returns menu hints.

func (*Logger) Init added in v0.23.0

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

Init initializes the viewer.

func (*Logger) Name added in v0.23.0

func (l *Logger) Name() string

Name returns the component name.

func (*Logger) SetSubject added in v0.23.0

func (l *Logger) SetSubject(s string)

SetSubject updates the subject.

func (*Logger) Start added in v0.23.0

func (l *Logger) Start()

Start starts the view updater.

func (*Logger) Stop added in v0.23.0

func (l *Logger) Stop()

Stop terminates the updater.

func (*Logger) StylesChanged added in v0.23.0

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 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 added in v0.19.5

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 added in v0.13.3

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 added in v0.24.11

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) 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 Popeye added in v0.19.0

type Popeye struct {
	ResourceViewer
}

Popeye represents a sanitizer view.

func (*Popeye) Init added in v0.19.0

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

Init initializes the view.

type PortForward

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

PortForward presents active portforward viewer.

type PortForwardCB added in v0.18.0

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

PortForwardCB represents a port-forward callback function.

type PortForwardExtender added in v0.15.2

type PortForwardExtender struct {
	ResourceViewer
}

PortForwardExtender adds port-forward extensions.

type Pulse added in v0.16.0

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

Pulse represents a command health view.

func (*Pulse) Actions added in v0.16.0

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

Actions returns active menu bindings.

func (*Pulse) AddBindKeysFn added in v0.23.0

func (p *Pulse) AddBindKeysFn(BindKeysFunc)

AddBindKeysFn sets up extra key bindings.

func (*Pulse) App added in v0.16.0

func (p *Pulse) App() *App

App returns the current app handle.

func (*Pulse) ExtraHints added in v0.16.0

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

ExtraHints returns additional hints.

func (*Pulse) GVR added in v0.16.0

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

GVR returns a resource descriptor.

func (*Pulse) GetTable added in v0.16.0

func (p *Pulse) GetTable() *Table

GetTable return the view table if any.

func (*Pulse) Hints added in v0.16.0

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

Hints returns the view hints.

func (*Pulse) InCmdMode added in v0.24.11

func (*Pulse) InCmdMode() bool

InCmdMode checks if prompt is active.

func (*Pulse) Init added in v0.16.0

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

Init initializes the view.

func (*Pulse) Name added in v0.16.0

func (p *Pulse) Name() string

Name returns the component name.

func (*Pulse) PulseChanged added in v0.16.0

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

PulseChanged notifies the model data changed.

func (*Pulse) PulseFailed added in v0.16.0

func (p *Pulse) PulseFailed(err error)

PulseFailed notifies the load failed.

func (*Pulse) Refresh added in v0.16.0

func (p *Pulse) Refresh()

Refresh updates the view.

func (*Pulse) SetContextFn added in v0.16.0

func (p *Pulse) SetContextFn(ContextFunc)

SetContextFn sets custom context.

func (*Pulse) SetEnvFn added in v0.16.0

func (p *Pulse) SetEnvFn(EnvFunc)

SetEnvFn sets the custom environment function.

func (*Pulse) SetInstance added in v0.16.0

func (p *Pulse) SetInstance(string)

SetInstance sets specific resource instance.

func (*Pulse) Start added in v0.16.0

func (p *Pulse) Start()

Start initializes resource watch loop.

func (*Pulse) Stop added in v0.16.0

func (p *Pulse) Stop()

Stop terminates watch loop.

func (*Pulse) StylesChanged added in v0.16.0

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 added in v0.20.0

type Reference struct {
	ResourceViewer
}

Reference represents resource references.

func (*Reference) Init added in v0.20.0

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)

	// AddBindKeys 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 NewConfigMap added in v0.20.0

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 added in v0.21.0

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 NewHelm added in v0.19.3

func NewHelm(gvr client.GVR) ResourceViewer

NewHelm returns a new alias view.

func NewImageExtender added in v0.23.0

func NewImageExtender(r ResourceViewer) ResourceViewer

NewImageExtender returns a new extender.

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 NewPersistentVolumeClaim added in v0.19.5

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 NewPopeye added in v0.19.0

func NewPopeye(gvr client.GVR) ResourceViewer

NewPopeye returns a new view.

func NewPortForward

func NewPortForward(gvr client.GVR) ResourceViewer

NewPortForward returns a new viewer.

func NewPortForwardExtender added in v0.15.2

func NewPortForwardExtender(r ResourceViewer) ResourceViewer

NewPortForwardExtender returns a new extender.

func NewPulse added in v0.16.0

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 added in v0.20.0

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 added in v0.19.0

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 added in v0.20.0

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 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() []string
	EnvFn() EnvFunc
}

Runner represents a runnable action handler.

type Sanitizer added in v0.19.0

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

Sanitizer represents an sanitizer tree view.

func (*Sanitizer) AddBindKeysFn added in v0.23.0

func (s *Sanitizer) AddBindKeysFn(BindKeysFunc)

AddBindKeysFn sets up extra key bindings.

func (*Sanitizer) Aliases added in v0.19.0

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

Aliases returns all available aliases.

func (*Sanitizer) App added in v0.19.0

func (s *Sanitizer) App() *App

App returns the current app handle.

func (*Sanitizer) BufferActive added in v0.19.0

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

BufferActive indicates the buff activity changed.

func (*Sanitizer) BufferChanged added in v0.19.0

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

BufferChanged indicates the buffer was changed.

func (*Sanitizer) BufferCompleted added in v0.23.0

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

BufferCompleted indicates input was accepted.

func (*Sanitizer) EnvFn added in v0.19.0

func (s *Sanitizer) EnvFn() EnvFunc

EnvFn returns an plugin env function if available.

func (*Sanitizer) ExtraHints added in v0.19.0

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

ExtraHints returns additional hints.

func (*Sanitizer) GVR added in v0.19.0

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

GVR returns a resource descriptor.

func (*Sanitizer) GetSelectedPath added in v0.19.0

func (s *Sanitizer) GetSelectedPath() string

GetSelectedPath returns the current selection as string.

func (*Sanitizer) GetTable added in v0.19.0

func (s *Sanitizer) GetTable() *Table

GetTable returns the underlying table.

func (*Sanitizer) InCmdMode added in v0.24.11

func (*Sanitizer) InCmdMode() bool

InCmdMode checks if prompt is active.

func (*Sanitizer) Init added in v0.19.0

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

Init initializes the view.

func (*Sanitizer) Name added in v0.19.0

func (s *Sanitizer) Name() string

Name returns the component name.

func (*Sanitizer) Refresh added in v0.19.0

func (s *Sanitizer) Refresh()

Refresh updates the view.

func (*Sanitizer) SetContextFn added in v0.19.0

func (s *Sanitizer) SetContextFn(f ContextFunc)

SetContextFn sets custom context.

func (*Sanitizer) SetEnvFn added in v0.19.0

func (s *Sanitizer) SetEnvFn(EnvFunc)

SetEnvFn sets the custom environment function.

func (*Sanitizer) SetInstance added in v0.19.0

func (s *Sanitizer) SetInstance(string)

SetInstance sets specific resource instance.

func (*Sanitizer) Start added in v0.19.0

func (s *Sanitizer) Start()

Start initializes resource watch loop.

func (*Sanitizer) Stop added in v0.19.0

func (s *Sanitizer) Stop()

Stop terminates watch loop.

func (*Sanitizer) TreeChanged added in v0.19.0

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

TreeChanged notifies the model data changed.

func (*Sanitizer) TreeLoadFailed added in v0.19.0

func (s *Sanitizer) TreeLoadFailed(err error)

TreeLoadFailed notifies the load failed.

func (*Sanitizer) TreeNodeSelected added in v0.19.0

func (s *Sanitizer) TreeNodeSelected()

TreeNodeSelected callback for node selection.

func (*Sanitizer) UpdateTitle added in v0.19.0

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 added in v0.20.0

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 added in v0.23.0

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 added in v0.23.0

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 added in v0.24.12

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 added in v0.17.0

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

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

TableViewer represents a tabular viewer.

type User

type User struct {
	ResourceViewer
}

User presents a user 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 Xray

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

Xray represents an xray tree view.

func (*Xray) AddBindKeysFn added in v0.23.0

func (x *Xray) AddBindKeysFn(BindKeysFunc)

AddBindKeysFn sets up extra key bindings.

func (*Xray) Aliases

func (x *Xray) Aliases() []string

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 added in v0.23.0

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 added in v0.13.3

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 added in v0.13.3

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 added in v0.24.11

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) SetInstance

func (x *Xray) SetInstance(string)

SetInstance sets specific resource instance.

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.

Jump to

Keyboard shortcuts

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