Documentation ¶
Index ¶
- Constants
- Variables
- func FQN(ns, n string) string
- func MetaFQN(m metav1.ObjectMeta) string
- func NewExpBackOff(ctx context.Context, start, max time.Duration) backoff.BackOffContext
- func NormalizeVersion(version string) string
- func Truncate(str string, width int) string
- type BuffWatcher
- type BufferKind
- type Cluster
- type ClusterInfo
- type ClusterInfoListener
- type ClusterMeta
- type CmdBuff
- func (c *CmdBuff) Add(r rune)
- func (c *CmdBuff) AddListener(w BuffWatcher)
- func (c *CmdBuff) ClearText(fire bool)
- func (c *CmdBuff) Delete()
- func (c *CmdBuff) Empty() bool
- func (c *CmdBuff) GetSuggestion() string
- func (c *CmdBuff) GetText() string
- func (c *CmdBuff) InCmdMode() bool
- func (c *CmdBuff) IsActive() bool
- func (c *CmdBuff) RemoveListener(l BuffWatcher)
- func (c *CmdBuff) Reset()
- func (c *CmdBuff) SetActive(b bool)
- func (c *CmdBuff) SetText(text, suggestion string)
- type Commander
- type Component
- type Cruder
- type Describe
- func (d *Describe) AddListener(l ResourceViewerListener)
- func (d *Describe) ClearFilter()
- func (d *Describe) Filter(q string)
- func (d *Describe) GetPath() string
- func (d *Describe) Peek() []string
- func (d *Describe) Refresh(ctx context.Context) error
- func (d *Describe) RemoveListener(l ResourceViewerListener)
- func (d *Describe) SetOptions(context.Context, ViewerToggleOpts)
- func (d *Describe) Watch(ctx context.Context) error
- type Describer
- type Filterable
- type FishBuff
- func (f *FishBuff) Add(r rune)
- func (f *FishBuff) AutoSuggests() bool
- func (f *FishBuff) ClearSuggestions()
- func (f *FishBuff) CurrentSuggestion() (string, bool)
- func (f *FishBuff) Delete()
- func (f *FishBuff) NextSuggestion() (string, bool)
- func (f *FishBuff) Notify(delete bool)
- func (f *FishBuff) PrevSuggestion() (string, bool)
- func (f *FishBuff) SetSuggestionFn(fn SuggestionFunc)
- func (f *FishBuff) Suggestions() []string
- type Flash
- func (f *Flash) Channel() FlashChan
- func (f *Flash) Clear()
- func (f *Flash) Err(err error)
- func (f *Flash) Errf(fmat string, args ...interface{})
- func (f *Flash) Info(msg string)
- func (f *Flash) Infof(fmat string, args ...interface{})
- func (f *Flash) SetMessage(level FlashLevel, msg string)
- func (f *Flash) Warn(msg string)
- func (f *Flash) Warnf(fmat string, args ...interface{})
- type FlashChan
- type FlashLevel
- type FlashListener
- type Generic
- type Hint
- type HintListener
- type Hinter
- type History
- type Igniter
- type LevelMessage
- type Lister
- type Log
- func (l *Log) AddListener(listener LogsListener)
- func (l *Log) Append(line *dao.LogItem)
- func (l *Log) Clear()
- func (l *Log) ClearFilter()
- func (l *Log) Configure(opts *config.Logger)
- func (l *Log) Filter(q string)
- func (l *Log) GVR() client.GVR
- func (l *Log) GetContainer() string
- func (l *Log) GetPath() string
- func (l *Log) HasDefaultContainer() bool
- func (l *Log) Head(ctx context.Context)
- func (l *Log) Init(f dao.Factory)
- func (l *Log) IsHead() bool
- func (l *Log) LogOptions() *dao.LogOptions
- func (l *Log) Notify()
- func (l *Log) Refresh()
- func (l *Log) RemoveListener(listener LogsListener)
- func (l *Log) Restart(ctx context.Context)
- func (l *Log) Set(lines *dao.LogItems)
- func (l *Log) SetSinceSeconds(ctx context.Context, i int64)
- func (l *Log) SinceSeconds() int64
- func (l *Log) Start(ctx context.Context)
- func (l *Log) Stop()
- func (l *Log) ToggleAllContainers(ctx context.Context)
- func (l *Log) ToggleShowTimestamp(b bool)
- type LogsListener
- type MenuHint
- type MenuHints
- type MetricsServer
- type MetricsService
- type Primitive
- type Pulse
- type PulseHealth
- type PulseListener
- type Renderer
- type ResourceMeta
- type ResourceViewer
- type ResourceViewerListener
- type SemVer
- type Stack
- func (s *Stack) AddListener(l StackListener)
- func (s *Stack) Clear()
- func (s *Stack) Dump()
- func (s *Stack) Empty() bool
- func (s *Stack) Flatten() []string
- func (s *Stack) IsLast() bool
- func (s *Stack) Peek() []Component
- func (s *Stack) Pop() (Component, bool)
- func (s *Stack) Previous() Component
- func (s *Stack) Push(c Component)
- func (s *Stack) RemoveListener(l StackListener)
- func (s *Stack) Top() Component
- type StackAction
- type StackEvent
- type StackListener
- type SuggestionFunc
- type SuggestionListener
- type Table
- func (t *Table) AddListener(l TableListener)
- func (t *Table) ClusterWide() bool
- func (t *Table) Count() int
- func (t *Table) Delete(ctx context.Context, path string, propagation *metav1.DeletionPropagation, ...) error
- func (t *Table) Empty() bool
- func (t *Table) Get(ctx context.Context, path string) (runtime.Object, error)
- func (t *Table) GetNamespace() string
- func (t *Table) InNamespace(ns string) bool
- func (t *Table) Peek() render.TableData
- func (t *Table) Refresh(ctx context.Context) error
- func (t *Table) RemoveListener(l TableListener)
- func (t *Table) SetInstance(path string)
- func (t *Table) SetLabelFilter(f string)
- func (t *Table) SetNamespace(ns string)
- func (t *Table) SetRefreshRate(d time.Duration)
- func (t *Table) Watch(ctx context.Context) error
- type TableListener
- type Text
- type TextListener
- type Textable
- type Tree
- func (t *Tree) AddListener(l TreeListener)
- func (t *Tree) ClearFilter()
- func (t *Tree) ClusterWide() bool
- func (t *Tree) Describe(ctx context.Context, gvr, path string) (string, error)
- func (t *Tree) Empty() bool
- func (t *Tree) GetNamespace() string
- func (t *Tree) InNamespace(ns string) bool
- func (t *Tree) Peek() *xray.TreeNode
- func (t *Tree) Refresh(ctx context.Context)
- func (t *Tree) RemoveListener(l TreeListener)
- func (t *Tree) SetFilter(q string)
- func (t *Tree) SetNamespace(ns string)
- func (t *Tree) SetRefreshRate(d time.Duration)
- func (t *Tree) ToYAML(ctx context.Context, gvr, path string) (string, error)
- func (t *Tree) Watch(ctx context.Context)
- type TreeListener
- type TreeRenderer
- type Values
- func (v *Values) AddListener(l ResourceViewerListener)
- func (v *Values) ClearFilter()
- func (v *Values) Filter(q string)
- func (v *Values) GetPath() string
- func (v *Values) Peek() []string
- func (v *Values) Refresh(ctx context.Context) error
- func (v *Values) RemoveListener(l ResourceViewerListener)
- func (v *Values) SetOptions(ctx context.Context, opts ViewerToggleOpts)
- func (v *Values) ToggleValues()
- func (v *Values) Watch(ctx context.Context) error
- type ViewerToggleOpts
- type YAML
- func (y *YAML) AddListener(l ResourceViewerListener)
- func (y *YAML) ClearFilter()
- func (y *YAML) Filter(q string)
- func (y *YAML) GetPath() string
- func (y *YAML) Peek() []string
- func (y *YAML) Refresh(ctx context.Context) error
- func (y *YAML) RemoveListener(l ResourceViewerListener)
- func (y *YAML) SetOptions(ctx context.Context, opts ViewerToggleOpts)
- func (y *YAML) ToYAML(ctx context.Context, gvr client.GVR, path string, showManaged bool) (string, error)
- func (y *YAML) Watch(ctx context.Context) error
Constants ¶
const ManagedFieldsOpts = "ManagedFields"
ManagedFieldsOpts tracks managed fields.
const MaxHistory = 20
MaxHistory tracks max command history.
Variables ¶
var Registry = map[string]ResourceMeta{ "references": { DAO: &dao.Reference{}, Renderer: &render.Reference{}, }, "dir": { DAO: &dao.Dir{}, Renderer: &render.Dir{}, }, "pulses": { DAO: &dao.Pulse{}, }, "helm": { DAO: &dao.Helm{}, Renderer: &render.Helm{}, }, "containers": { DAO: &dao.Container{}, Renderer: &render.Container{}, TreeRenderer: &xray.Container{}, }, "contexts": { DAO: &dao.Context{}, Renderer: &render.Context{}, }, "screendumps": { DAO: &dao.ScreenDump{}, Renderer: &render.ScreenDump{}, }, "rbac": { DAO: &dao.Rbac{}, Renderer: &render.Rbac{}, }, "policy": { DAO: &dao.Policy{}, Renderer: &render.Policy{}, }, "users": { DAO: &dao.Subject{}, Renderer: &render.Subject{}, }, "groups": { DAO: &dao.Subject{}, Renderer: &render.Subject{}, }, "portforwards": { DAO: &dao.PortForward{}, Renderer: &render.PortForward{}, }, "benchmarks": { DAO: &dao.Benchmark{}, Renderer: &render.Benchmark{}, }, "aliases": { DAO: &dao.Alias{}, Renderer: &render.Alias{}, }, "popeye": { DAO: &dao.Popeye{}, Renderer: &render.Popeye{}, }, "sanitizer": { DAO: &dao.Popeye{}, TreeRenderer: &xray.Section{}, }, "v1/endpoints": { Renderer: &render.Endpoints{}, }, "v1/pods": { DAO: &dao.Pod{}, Renderer: &render.Pod{}, TreeRenderer: &xray.Pod{}, }, "v1/namespaces": { Renderer: &render.Namespace{}, }, "v1/nodes": { DAO: &dao.Node{}, Renderer: &render.Node{}, }, "v1/services": { DAO: &dao.Service{}, Renderer: &render.Service{}, TreeRenderer: &xray.Service{}, }, "v1/serviceaccounts": { Renderer: &render.ServiceAccount{}, }, "v1/persistentvolumes": { Renderer: &render.PersistentVolume{}, }, "v1/persistentvolumeclaims": { Renderer: &render.PersistentVolumeClaim{}, }, "v1/events": { DAO: &dao.Table{}, Renderer: &render.Event{}, }, "apps/v1/deployments": { DAO: &dao.Deployment{}, Renderer: &render.Deployment{}, TreeRenderer: &xray.Deployment{}, }, "apps/v1/replicasets": { Renderer: &render.ReplicaSet{}, TreeRenderer: &xray.ReplicaSet{}, }, "apps/v1/statefulsets": { DAO: &dao.StatefulSet{}, Renderer: &render.StatefulSet{}, TreeRenderer: &xray.StatefulSet{}, }, "apps/v1/daemonsets": { DAO: &dao.DaemonSet{}, Renderer: &render.DaemonSet{}, TreeRenderer: &xray.DaemonSet{}, }, "networking.k8s.io/v1/networkpolicies": { Renderer: &render.NetworkPolicy{}, }, "batch/v1beta1/cronjobs": { DAO: &dao.CronJob{}, Renderer: &render.CronJob{}, }, "batch/v1/jobs": { DAO: &dao.Job{}, Renderer: &render.Job{}, }, "autoscaling/v1/horizontalpodautoscalers": { DAO: &dao.HorizontalPodAutoscaler{}, Renderer: &render.HorizontalPodAutoscaler{}, }, "autoscaling/v2beta1/horizontalpodautoscalers": { DAO: &dao.HorizontalPodAutoscaler{}, Renderer: &render.HorizontalPodAutoscaler{}, }, "autoscaling/v2beta2/horizontalpodautoscalers": { DAO: &dao.HorizontalPodAutoscaler{}, Renderer: &render.HorizontalPodAutoscaler{}, }, "apiextensions.k8s.io/v1/customresourcedefinitions": { Renderer: &render.CustomResourceDefinition{}, }, "storage.k8s.io/v1/storageclasses": { Renderer: &render.StorageClass{}, }, "policy/v1beta1/poddisruptionbudgets": { Renderer: &render.PodDisruptionBudget{}, }, "rbac.authorization.k8s.io/v1/clusterroles": { DAO: &dao.Rbac{}, Renderer: &render.ClusterRole{}, }, "rbac.authorization.k8s.io/v1/clusterrolebindings": { Renderer: &render.ClusterRoleBinding{}, }, "rbac.authorization.k8s.io/v1/roles": { Renderer: &render.Role{}, }, "rbac.authorization.k8s.io/v1/rolebindings": { Renderer: &render.RoleBinding{}, }, }
Registry tracks resources metadata. BOZO!! Break up deps and merge into single registrar.
Functions ¶
func MetaFQN ¶
func MetaFQN(m metav1.ObjectMeta) string
MetaFQN returns a fully qualified resource name.
func NewExpBackOff ¶ added in v0.23.0
NewExpBackOff returns a new exponential backoff timer.
func NormalizeVersion ¶ added in v0.23.8
NormalizeVersion ensures the version starts with a v.
Types ¶
type BuffWatcher ¶ added in v0.18.0
type BuffWatcher interface { // BufferCompleted indicates input was accepted. BufferCompleted(text, suggestion string) // BufferChanged indicates the buffer was changed. BufferChanged(text, suggestion string) // BufferActive indicates the buff activity changed. BufferActive(state bool, kind BufferKind) }
BuffWatcher represents a command buffer listener.
type BufferKind ¶ added in v0.18.0
type BufferKind int8
BufferKind indicates a buffer type.
const ( // CommandBuffer represents a command buffer. CommandBuffer BufferKind = 1 << iota // FilterBuffer represents a filter buffer. FilterBuffer )
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
Cluster represents a kubernetes resource.
func NewCluster ¶
NewCluster returns a new cluster info resource.
func (*Cluster) ClusterName ¶
ClusterName returns the cluster name.
func (*Cluster) ContextName ¶
ContextName returns the context name.
type ClusterInfo ¶ added in v0.13.5
type ClusterInfo struct {
// contains filtered or unexported fields
}
ClusterInfo models cluster metadata.
func NewClusterInfo ¶ added in v0.13.5
func NewClusterInfo(f dao.Factory, v string) *ClusterInfo
NewClusterInfo returns a new instance.
func (*ClusterInfo) AddListener ¶ added in v0.13.5
func (c *ClusterInfo) AddListener(l ClusterInfoListener)
AddListener adds a new model listener.
func (*ClusterInfo) Refresh ¶ added in v0.13.5
func (c *ClusterInfo) Refresh()
Refresh fetches the latest cluster meta.
func (*ClusterInfo) RemoveListener ¶ added in v0.13.5
func (c *ClusterInfo) RemoveListener(l ClusterInfoListener)
RemoveListener delete a listener from the list.
func (*ClusterInfo) Reset ¶ added in v0.13.5
func (c *ClusterInfo) Reset(f dao.Factory)
Reset resets context and reload.
type ClusterInfoListener ¶ added in v0.13.5
type ClusterInfoListener interface { // ClusterInfoChanged notifies the cluster meta was changed. ClusterInfoChanged(prev, curr ClusterMeta) // ClusterInfoUpdated notifies the cluster meta was updated. ClusterInfoUpdated(ClusterMeta) }
ClusterInfoListener registers a listener for model changes.
type ClusterMeta ¶ added in v0.13.5
type ClusterMeta struct {
Context, Cluster string
User string
K9sVer, K9sLatest string
K8sVer string
Cpu, Mem, Ephemeral int
}
ClusterMeta represents cluster meta data.
func NewClusterMeta ¶ added in v0.13.5
func NewClusterMeta() ClusterMeta
NewClusterMeta returns a new instance.
func (ClusterMeta) Deltas ¶ added in v0.13.5
func (c ClusterMeta) Deltas(n ClusterMeta) bool
Deltas diffs cluster meta return true if different, false otherwise.
type CmdBuff ¶ added in v0.18.0
type CmdBuff struct {
// contains filtered or unexported fields
}
CmdBuff represents user command input.
func NewCmdBuff ¶ added in v0.18.0
func NewCmdBuff(key rune, kind BufferKind) *CmdBuff
NewCmdBuff returns a new command buffer.
func (*CmdBuff) AddListener ¶ added in v0.18.0
func (c *CmdBuff) AddListener(w BuffWatcher)
AddListener registers a cmd buffer listener.
func (*CmdBuff) Delete ¶ added in v0.18.0
func (c *CmdBuff) Delete()
Delete removes the last character from the buffer.
func (*CmdBuff) GetSuggestion ¶ added in v0.25.1
GetSuggestion returns the current suggestion.
func (*CmdBuff) InCmdMode ¶ added in v0.18.0
InCmdMode checks if a command exists and the buffer is active.
func (*CmdBuff) RemoveListener ¶ added in v0.18.0
func (c *CmdBuff) RemoveListener(l BuffWatcher)
RemoveListener removes a listener.
func (*CmdBuff) Reset ¶ added in v0.18.0
func (c *CmdBuff) Reset()
Reset clears out the command buffer and deactivates it.
type Commander ¶ added in v0.24.11
type Commander interface { // InCmdMode checks if prompt is active. InCmdMode() bool }
Commander tracks prompt status.
type Cruder ¶
type Cruder interface { // List returns a collection of resources. List(ctx context.Context, ns string) ([]runtime.Object, error) // Get returns a resource instance. Get(ctx context.Context, path string) (runtime.Object, error) }
Cruder performs crud operations.
type Describe ¶ added in v0.23.0
type Describe struct {
// contains filtered or unexported fields
}
Describe tracks describable resources.
func NewDescribe ¶ added in v0.23.0
NewDescribe returns a new describe resource model.
func (*Describe) AddListener ¶ added in v0.23.0
func (d *Describe) AddListener(l ResourceViewerListener)
AddListener adds a new model listener.
func (*Describe) ClearFilter ¶ added in v0.23.0
func (d *Describe) ClearFilter()
ClearFilter clear out the filter.
func (*Describe) RemoveListener ¶ added in v0.23.0
func (d *Describe) RemoveListener(l ResourceViewerListener)
RemoveListener delete a listener from the list.
func (*Describe) SetOptions ¶ added in v0.23.0
func (d *Describe) SetOptions(context.Context, ViewerToggleOpts)
SetOptions toggle model options.
type Describer ¶
type Describer interface { // ToYAML return resource yaml. ToYAML(ctx context.Context, path string) (string, error) // Describe returns a resource description. Describe(client client.Connection, gvr, path string) (string, error) }
Describer represents a resource describer.
type Filterable ¶ added in v0.23.0
type Filterable interface { Filter(string) ClearFilter() }
Filterable represents an entity that can be filtered.
type FishBuff ¶ added in v0.18.0
type FishBuff struct { *CmdBuff // contains filtered or unexported fields }
FishBuff represents a suggestion buffer.
func NewFishBuff ¶ added in v0.18.0
func NewFishBuff(key rune, kind BufferKind) *FishBuff
NewFishBuff returns a new command buffer.
func (*FishBuff) AutoSuggests ¶ added in v0.19.1
AutoSuggests returns true if model implements auto suggestions.
func (*FishBuff) ClearSuggestions ¶ added in v0.19.1
func (f *FishBuff) ClearSuggestions()
ClearSuggestions clear out all suggestions.
func (*FishBuff) CurrentSuggestion ¶ added in v0.19.1
CurrentSuggestion returns the current suggestion.
func (*FishBuff) Delete ¶ added in v0.18.0
func (f *FishBuff) Delete()
Delete removes the last character from the buffer.
func (*FishBuff) NextSuggestion ¶ added in v0.19.1
NextSuggestion returns the next suggestion.
func (*FishBuff) PrevSuggestion ¶ added in v0.19.1
PrevSuggestion returns the prev suggestion.
func (*FishBuff) SetSuggestionFn ¶ added in v0.18.0
func (f *FishBuff) SetSuggestionFn(fn SuggestionFunc)
SetSuggestionFn sets up suggestions.
func (*FishBuff) Suggestions ¶ added in v0.19.1
Suggestions returns suggestions.
type Flash ¶ added in v0.16.0
type Flash struct {
// contains filtered or unexported fields
}
Flash represents a flash message model.
func (*Flash) SetMessage ¶ added in v0.16.0
func (f *Flash) SetMessage(level FlashLevel, msg string)
SetMessage sets the flash level message.
type FlashChan ¶ added in v0.16.0
type FlashChan chan LevelMessage
FlashChan represents a flash event channel.
type FlashLevel ¶ added in v0.16.0
type FlashLevel int
FlashLevel represents flash message severity.
const ( // DefaultFlashDelay sets the flash clear delay. DefaultFlashDelay = 3 * time.Second // FlashInfo represents an info message. FlashInfo FlashLevel = iota // FlashWarn represents an warning message. FlashWarn // FlashErr represents an error message. FlashErr )
type FlashListener ¶ added in v0.16.0
type FlashListener interface { // FlashChanged notifies the model changed. FlashChanged(FlashLevel, string) // FlashCleared notifies when the filter changed. FlashCleared() }
FlashListener represents a text model listener.
type Hint ¶
type Hint struct {
// contains filtered or unexported fields
}
Hint represent a hint model.
func (*Hint) AddListener ¶
func (h *Hint) AddListener(l HintListener)
AddListener adds a hint listener.
func (*Hint) RemoveListener ¶
func (h *Hint) RemoveListener(l HintListener)
RemoveListener deletes a listener.
type HintListener ¶
type HintListener interface {
HintsChanged(MenuHints)
}
HintListener represents a menu hints listener.
type Hinter ¶
type Hinter interface { // Hints returns a collection of menu hints. Hints() MenuHints // ExtraHints returns additional hints. ExtraHints() map[string]string }
Hinter represent a menu mnemonic provider.
type History ¶ added in v0.19.0
type History struct {
// contains filtered or unexported fields
}
History represents a command history.
func NewHistory ¶ added in v0.19.0
NewHistory returns a new instance.
type Igniter ¶
type Igniter interface { // Start starts a component. Init(ctx context.Context) error // Start starts a component. Start() // Stop terminates a component. Stop() }
Igniter represents a runnable view.
type LevelMessage ¶ added in v0.16.0
type LevelMessage struct { Level FlashLevel Text string }
LevelMessage tracks an message and severity.
func (LevelMessage) IsClear ¶ added in v0.16.0
func (l LevelMessage) IsClear() bool
IsClear returns true if message is empty.
type Lister ¶
type Lister interface { Cruder // Init initializes a resource. Init(ns, gvr string, f dao.Factory) }
Lister represents a resource lister.
type Log ¶
type Log struct {
// contains filtered or unexported fields
}
Log represents a resource logger.
func (*Log) AddListener ¶
func (l *Log) AddListener(listener LogsListener)
AddListener adds a new model listener.
func (*Log) GetContainer ¶
GetContainer returns the resource container if any or "" otherwise.
func (*Log) HasDefaultContainer ¶ added in v0.24.11
HasDefaultContainer returns true if the pod has a default container, false otherwise.
func (*Log) LogOptions ¶ added in v0.18.0
func (l *Log) LogOptions() *dao.LogOptions
func (*Log) RemoveListener ¶
func (l *Log) RemoveListener(listener LogsListener)
RemoveListener delete a listener from the list.
func (*Log) SetSinceSeconds ¶ added in v0.23.4
SetSinceSeconds sets the logs retrieval time.
func (*Log) SinceSeconds ¶ added in v0.18.0
SinceSeconds returns since seconds option.
func (*Log) ToggleAllContainers ¶ added in v0.24.11
ToggleAllContainers toggles to show all containers logs.
func (*Log) ToggleShowTimestamp ¶ added in v0.23.4
ToggleShowTimestamp toggles to logs timestamps.
type LogsListener ¶
type LogsListener interface { // LogChanged notifies the model changed. LogChanged([][]byte) // LogCleared indicates logs are cleared. LogCleared() // LogFailed indicates a log failure. LogFailed(error) // LogStop indicates logging was canceled. LogStop() // LogResume indicates loggings has resumed. LogResume() // LogCanceled indicates no more logs will come. LogCanceled() }
LogsListener represents a log model listener.
type MenuHint ¶
MenuHint represents keyboard mnemonic.
type MenuHints ¶
type MenuHints []MenuHint
MenuHints represents a collection of hints.
type MetricsServer ¶
type MetricsServer interface { MetricsService ClusterLoad(*v1.NodeList, *mv1beta1.NodeMetricsList, *client.ClusterMetrics) error NodesMetrics(*v1.NodeList, *mv1beta1.NodeMetricsList, client.NodesMetrics) PodsMetrics(*mv1beta1.PodMetricsList, client.PodsMetrics) }
MetricsServer gather metrics information from pods and nodes.
type MetricsService ¶
type MetricsService interface { HasMetrics() bool FetchNodesMetrics(ctx context.Context) (*mv1beta1.NodeMetricsList, error) FetchPodsMetrics(ctx context.Context, ns string) (*mv1beta1.PodMetricsList, error) }
MetricsService calls the metrics server for metrics info.
type Pulse ¶ added in v0.16.0
type Pulse struct {
// contains filtered or unexported fields
}
Pulse tracks multiple resources health.
func (*Pulse) AddListener ¶ added in v0.16.0
func (p *Pulse) AddListener(l PulseListener)
AddListener adds a listener.
func (*Pulse) GetNamespace ¶ added in v0.16.0
GetNamespace returns the model namespace.
func (*Pulse) RemoveListener ¶ added in v0.16.0
func (p *Pulse) RemoveListener(l PulseListener)
RemoveListener delete a listener.
func (*Pulse) SetNamespace ¶ added in v0.16.0
SetNamespace sets up model namespace.
type PulseHealth ¶ added in v0.16.0
type PulseHealth struct {
// contains filtered or unexported fields
}
PulseHealth tracks resources health.
func NewPulseHealth ¶ added in v0.16.0
func NewPulseHealth(f dao.Factory) *PulseHealth
NewPulseHealth returns a new instance.
type PulseListener ¶ added in v0.16.0
type PulseListener interface { // PulseChanged notifies the model data changed. PulseChanged(*health.Check) // TreeFailed notifies the health check failed. PulseFailed(error) }
PulseListener represents a health model listener.
type Renderer ¶
type Renderer interface { // IsGeneric identifies a generic handler. IsGeneric() bool // Render converts raw resources to tabular data. Render(o interface{}, ns string, row *render.Row) error // Header returns the resource header. Header(ns string) render.Header // ColorerFunc returns a row colorer function. ColorerFunc() render.ColorerFunc }
Renderer represents a resource renderer.
type ResourceMeta ¶
type ResourceMeta struct { DAO dao.Accessor Renderer Renderer TreeRenderer TreeRenderer }
ResourceMeta represents model info about a resource.
type ResourceViewer ¶ added in v0.23.0
type ResourceViewer interface { GetPath() string Filter(string) ClearFilter() Peek() []string SetOptions(context.Context, ViewerToggleOpts) Watch(context.Context) error Refresh(context.Context) error AddListener(ResourceViewerListener) RemoveListener(ResourceViewerListener) }
ResourceViewer represents a viewed resource.
type ResourceViewerListener ¶ added in v0.23.0
type ResourceViewerListener interface { ResourceChanged(lines []string, matches fuzzy.Matches) ResourceFailed(error) }
ResourceViewerListener listens to viewing resource events.
type SemVer ¶ added in v0.23.8
type SemVer struct {
Major, Minor, Patch int
}
SemVer represents a semantic version.
type Stack ¶
type Stack struct {
// contains filtered or unexported fields
}
Stack represents a stacks of components.
func (*Stack) AddListener ¶
func (s *Stack) AddListener(l StackListener)
AddListener registers a stack listener.
func (*Stack) RemoveListener ¶
func (s *Stack) RemoveListener(l StackListener)
RemoveListener removes a listener.
type StackAction ¶
type StackAction int
StackAction represents an action on the stack.
const ( // StackPush denotes an add on the stack. StackPush StackAction = 1 << iota // StackPop denotes a delete on the stack. StackPop )
type StackEvent ¶
type StackEvent struct { // Kind represents the event condition. Action StackAction // Item represents the targeted item. Component Component }
StackEvent represents an operation on a view stack.
type StackListener ¶
type StackListener interface { // StackPushed indicates a new item was added. StackPushed(Component) // StackPopped indicates an item was deleted StackPopped(old, new Component) // StackTop indicates the top of the stack StackTop(Component) }
StackListener represents a stack listener.
type SuggestionFunc ¶ added in v0.18.0
type SuggestionFunc func(text string) sort.StringSlice
SuggestionFunc produces suggestions.
type SuggestionListener ¶ added in v0.18.0
type SuggestionListener interface { BuffWatcher // SuggestionChanged notifies suggestion changes. SuggestionChanged(text, sugg string) }
SuggestionListener listens for suggestions.
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
Table represents a table model.
func (*Table) AddListener ¶
func (t *Table) AddListener(l TableListener)
AddListener adds a new model listener.
func (*Table) ClusterWide ¶
ClusterWide checks if resource is scope for all namespaces.
func (*Table) Delete ¶
func (t *Table) Delete(ctx context.Context, path string, propagation *metav1.DeletionPropagation, force bool) error
Delete deletes a resource.
func (*Table) GetNamespace ¶
GetNamespace returns the model namespace.
func (*Table) InNamespace ¶
InNamespace checks if current namespace matches desired namespace.
func (*Table) RemoveListener ¶
func (t *Table) RemoveListener(l TableListener)
RemoveListener delete a listener from the list.
func (*Table) SetInstance ¶
SetInstance sets a single entry table.
func (*Table) SetLabelFilter ¶ added in v0.20.3
SetLabelFilter sets the labels filter.
func (*Table) SetNamespace ¶
SetNamespace sets up model namespace.
func (*Table) SetRefreshRate ¶
SetRefreshRate sets model refresh duration.
type TableListener ¶
type TableListener interface { // TableDataChanged notifies the model data changed. TableDataChanged(render.TableData) // TableLoadFailed notifies the load failed. TableLoadFailed(error) }
TableListener represents a table model listener.
type Text ¶ added in v0.14.0
type Text struct {
// contains filtered or unexported fields
}
Text represents a text model.
func (*Text) AddListener ¶ added in v0.14.0
func (t *Text) AddListener(listener TextListener)
AddListener adds a new model listener.
func (*Text) ClearFilter ¶ added in v0.14.0
func (t *Text) ClearFilter()
ClearFilter clear out filter.
func (*Text) RemoveListener ¶ added in v0.14.0
func (t *Text) RemoveListener(listener TextListener)
RemoveListener delete a listener from the list.
type TextListener ¶ added in v0.14.0
type TextListener interface { // TextChanged notifies the model changed. TextChanged([]string) // TextFiltered notifies when the filter changed. TextFiltered([]string, fuzzy.Matches) }
TextListener represents a text model listener.
type Textable ¶ added in v0.23.0
type Textable interface { Peek() []string SetText(string) AddListener(TextListener) RemoveListener(TextListener) }
Textable represents a text resource.
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
Tree represents a tree model.
func (*Tree) ClusterWide ¶
ClusterWide checks if resource is scope for all namespaces.
func (*Tree) GetNamespace ¶
GetNamespace returns the model namespace.
func (*Tree) InNamespace ¶
InNamespace checks if current namespace matches desired namespace.
func (*Tree) RemoveListener ¶
func (t *Tree) RemoveListener(l TreeListener)
RemoveListener delete a listener.
func (*Tree) SetNamespace ¶
SetNamespace sets up model namespace.
func (*Tree) SetRefreshRate ¶
SetRefreshRate sets model refresh duration.
type TreeListener ¶
type TreeListener interface { // TreeChanged notifies the model data changed. TreeChanged(*xray.TreeNode) // TreeLoadFailed notifies the load failed. TreeLoadFailed(error) }
TreeListener represents a tree model listener.
type TreeRenderer ¶
TreeRenderer represents an xray node.
type Values ¶ added in v0.25.19
type Values struct {
// contains filtered or unexported fields
}
Values tracks Helm values representations.
func (*Values) AddListener ¶ added in v0.25.19
func (v *Values) AddListener(l ResourceViewerListener)
AddListener adds a new model listener.
func (*Values) ClearFilter ¶ added in v0.25.19
func (v *Values) ClearFilter()
ClearFilter clear out the filter.
func (*Values) RemoveListener ¶ added in v0.25.19
func (v *Values) RemoveListener(l ResourceViewerListener)
RemoveListener delete a listener from the list.
func (*Values) SetOptions ¶ added in v0.25.19
func (v *Values) SetOptions(ctx context.Context, opts ViewerToggleOpts)
SetOptions toggle model options.
func (*Values) ToggleValues ¶ added in v0.25.19
func (v *Values) ToggleValues()
ToggleValues toggles between user supplied values and computed values.
type ViewerToggleOpts ¶ added in v0.23.0
ViewerToggleOpts represents a collection of viewing options.
type YAML ¶ added in v0.23.0
type YAML struct {
// contains filtered or unexported fields
}
YAML tracks yaml resource representations.
func (*YAML) AddListener ¶ added in v0.23.0
func (y *YAML) AddListener(l ResourceViewerListener)
AddListener adds a new model listener.
func (*YAML) ClearFilter ¶ added in v0.23.0
func (y *YAML) ClearFilter()
ClearFilter clear out the filter.
func (*YAML) RemoveListener ¶ added in v0.23.0
func (y *YAML) RemoveListener(l ResourceViewerListener)
RemoveListener delete a listener from the list.
func (*YAML) SetOptions ¶ added in v0.23.0
func (y *YAML) SetOptions(ctx context.Context, opts ViewerToggleOpts)
SetOptions toggle model options.