view

package
v0.0.0-...-5b2b967 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2020 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

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

DismissDrain dismiss the port forward dialog.

func DismissLogs

func DismissLogs(a *App, p *ui.Pages)

DismissLogs dismiss the dialog.

func DismissPortForwards

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

DismissPortForwards dismiss the port forward dialog.

func ShowDrain

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

ShowDrain pops a node drain dialog.

func ShowLogs

func ShowLogs(a *App, path string, applyFn LogCB)

ShowLogs pops a port forwarding configuration dialog.

func ShowPortForwards

func ShowPortForwards(v ResourceViewer, path string, ports []string, 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) 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

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

BufferActive indicates the buff activity changed.

func (*Browser) BufferChanged

func (b *Browser) BufferChanged(s string)

BufferChanged indicates the buffer was changed.

func (*Browser) GetTable

func (b *Browser) GetTable() *Table

GetTable returns the underlying table.

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

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

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 ContainerFunc

type ContainerFunc func() string

ContainerFunc returns the active container 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 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.TextView
	// 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

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

BufferActive indicates the buff activity changed.

func (*Details) BufferChanged

func (d *Details) BufferChanged(s string)

BufferChanged indicates the buffer was changed.

func (*Details) ExtraHints

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

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, 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

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 Grapheable

type Grapheable 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
}

Grapheable represents a graphic component.

type Group

type Group struct {
	ResourceViewer
}

Group presents a RBAC group viewer.

type Helm

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() *Help

NewHelp returns a new help viewer.

func (*Help) Init

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

Init initializes the component.

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 Job

type Job struct {
	ResourceViewer
}

Job represents a job viewer.

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, path, co string, prev bool) *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(s string)

BufferChanged indicates the buffer was changed.

func (*Log) ExtraHints

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

ExtraHints returns additional hints.

func (*Log) Flush

func (l *Log) Flush(lines dao.LogItems)

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

func (l *Log) LogChanged(lines dao.LogItems)

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

func (l *Log) Logs() *Details

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(evt *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) 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 LogCB

type LogCB func(path string, opts dao.LogOptions)

LogCB represents a log callback function.

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) *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) 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 LogViewer

type LogViewer interface {
	ResourceViewer

	ShowLogs(prev bool)
}

LogViewer represents a log viewer.

type LogsExtender

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

LogsExtender adds log actions to a given viewer.

type Meow

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

Meow represents a bomb viewer

func NewMeow

func NewMeow(app *App, says string) *Meow

NewMeow returns a details viewer.

func (*Meow) Actions

func (m *Meow) Actions() ui.KeyActions

Actions returns menu actions

func (*Meow) ExtraHints

func (m *Meow) ExtraHints() map[string]string

ExtraHints returns additional hints.

func (*Meow) Hints

func (m *Meow) Hints() model.MenuHints

Hints returns menu hints.

func (*Meow) Init

func (m *Meow) Init(_ context.Context) error

Init initializes the viewer.

func (*Meow) Name

func (m *Meow) Name() string

Name returns the component name.

func (*Meow) Start

func (m *Meow) Start()

Start starts the view updater.

func (*Meow) Stop

func (m *Meow) Stop()

Stop terminates the updater.

func (*Meow) StylesChanged

func (m *Meow) StylesChanged(s *config.Styles)

StylesChanged notifies the skin changes.

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 OpenFaas

type OpenFaas struct {
	ResourceViewer
}

OpenFaas represents an OpenFaaS 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) 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

type Popeye struct {
	ResourceViewer
}

Popeye represents a sanitizer view.

func (*Popeye) Init

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

type PortForwardCB func(v ResourceViewer, path, co string, mapper []client.PortTunnel)

PortForwardCB represents a port-forward callback function.

type PortForwardExtender

type PortForwardExtender struct {
	ResourceViewer
}

PortForwardExtender adds port-forward extensions.

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

func (p *Pulse) SetBindKeysFn(BindKeysFunc)

SetBindKeysFn sets up extra key bindings.

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

func (p *Pulse) SetInstance(string)

SetInstance sets specific resource instance.

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)

	// SetBindKeys provision additional key bindings.
	SetBindKeysFn(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

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 NewHelm

func NewHelm(gvr client.GVR) ResourceViewer

NewHelm returns a new alias view.

func NewJob

func NewJob(gvr client.GVR) ResourceViewer

NewJob returns a new viewer.

func NewLogsExtender

func NewLogsExtender(v ResourceViewer, f ContainerFunc) 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 NewOpenFaas

func NewOpenFaas(gvr client.GVR) ResourceViewer

NewOpenFaas returns a new viewer.

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 NewPopeye

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

func NewPortForwardExtender(r ResourceViewer) ResourceViewer

NewPortForwardExtender returns a new extender.

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

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

Sanitizer represents an sanitizer tree view.

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(q string)

BufferChanged indicates the buffer was changed.

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

func (s *Sanitizer) SetBindKeysFn(BindKeysFunc)

SetBindKeysFn sets up extra key bindings.

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

func (s *Sanitizer) SetInstance(string)

SetInstance sets specific resource instance.

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) 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(s string)

BufferChanged indicates the buffer was changed.

func (*Table) EnvFn

func (t *Table) EnvFn() EnvFunc

EnvFn returns an plugin env function if available.

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

func (t *Table) SetBindKeysFn(f BindKeysFunc)

SetBindKeysFn adds additional key bindings.

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) 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(s string)

BufferChanged 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) 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) SetBindKeysFn

func (x *Xray) SetBindKeysFn(BindKeysFunc)

SetBindKeysFn sets up extra key bindings.

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