Documentation ¶
Index ¶
- Constants
- Variables
- func AppContextAliasesFile(cluster, context string) string
- func AppContextConfig(cluster, context string) string
- func AppContextDir(cluster, context string) string
- func AppContextHotkeysFile(cluster, context string) string
- func AppContextPluginsFile(cluster, context string) string
- func DumpsDir(cluster, context string) (string, error)
- func EnsureAliasesCfgFile() (string, error)
- func EnsureBenchmarksCfgFile(cluster, context string) (string, error)
- func EnsureBenchmarksDir(cluster, context string) (string, error)
- func EnsureHotkeysCfgFile() (string, error)
- func InNSList(nn []interface{}, ns string) bool
- func InitLocs() error
- func InitLogLoc() error
- func IsBoolSet(b *bool) bool
- func MustK9sUser() string
- func SkinFileFromName(n string) string
- func UserTmpDir() (string, error)
- type Alias
- type Aliases
- func (a *Aliases) AliasesFor(s string) []string
- func (a *Aliases) Clear()
- func (a *Aliases) Define(gvr string, aliases ...string)
- func (a *Aliases) Get(k string) (string, bool)
- func (a *Aliases) Keys() []string
- func (a *Aliases) Load(path string) error
- func (a *Aliases) LoadFile(path string) error
- func (a *Aliases) Save() error
- func (a *Aliases) SaveAliases(path string) error
- func (a *Aliases) ShortNames() ShortNames
- type Auth
- type Bench
- type BenchConfig
- type Benchmark
- type Benchmarks
- type Body
- type Border
- type Charts
- type Color
- type Colors
- type Config
- func (c *Config) ActiveContextName() string
- func (c *Config) ActiveNamespace() string
- func (c *Config) ActiveView() string
- func (c *Config) ContextAliasesPath() string
- func (c *Config) ContextHotkeysPath() string
- func (c *Config) ContextPluginsPath() (string, error)
- func (c *Config) CurrentContext() (*data.Context, error)
- func (c *Config) Dump(msg string)
- func (c *Config) FavNamespaces() []string
- func (c *Config) GetConnection() client.Connection
- func (c *Config) Load(path string, force bool) error
- func (c *Config) Merge(c1 *Config)
- func (c *Config) Refine(flags *genericclioptions.ConfigFlags, k9sFlags *Flags, cfg *client.Config) error
- func (c *Config) Reset()
- func (c *Config) Save(force bool) error
- func (c *Config) SaveFile(path string) error
- func (c *Config) SetActiveNamespace(ns string) error
- func (c *Config) SetActiveView(view string)
- func (c *Config) SetConnection(conn client.Connection)
- func (c *Config) SetCurrentContext(n string) (*data.Context, error)
- func (c *Config) Validate()
- type Crumb
- type CustomView
- type Dialog
- type Flags
- type Frame
- type HTTP
- type Help
- type HotKey
- type HotKeys
- type ImageScans
- type Info
- type K9s
- func (k *K9s) ActivateContext(n string) (*data.Context, error)
- func (k *K9s) ActiveContext() (*data.Context, error)
- func (k *K9s) ActiveContextName() string
- func (k *K9s) ActiveContextNamespace() (string, error)
- func (k *K9s) AppScreenDumpDir() string
- func (k *K9s) ContextScreenDumpDir() string
- func (k *K9s) GetRefreshRate() int
- func (k *K9s) IsCrumbsless() bool
- func (k *K9s) IsHeadless() bool
- func (k *K9s) IsLogoless() bool
- func (k *K9s) IsReadOnly() bool
- func (k *K9s) Merge(k1 *K9s)
- func (k *K9s) Override(k9sFlags *Flags)
- func (k *K9s) Reload() error
- func (k *K9s) Reset()
- func (k *K9s) Save(force bool) error
- func (k *K9s) Validate(c client.Connection, ks data.KubeSettings)
- type Labels
- type Limits
- type Log
- type LogIndicator
- type Logger
- type Menu
- type Picker
- type Plugin
- type Plugins
- type Prompt
- type PromptBorder
- type ScanExcludes
- type Severity
- type SeverityLevel
- type ShellPod
- type ShortNames
- type Status
- type Style
- type StyleListener
- type Styles
- func (s *Styles) AddListener(l StyleListener)
- func (s *Styles) BgColor() tcell.Color
- func (s *Styles) Body() Body
- func (s *Styles) Charts() Charts
- func (s *Styles) Crumb() Crumb
- func (s *Styles) Dialog() Dialog
- func (s *Styles) Dump()
- func (s *Styles) FgColor() tcell.Color
- func (s *Styles) Frame() Frame
- func (s *Styles) Load(path string) error
- func (s *Styles) Prompt() Prompt
- func (s *Styles) RemoveListener(l StyleListener)
- func (s *Styles) Reset()
- func (s *Styles) Table() Table
- func (s *Styles) Title() Title
- func (s *Styles) Update()
- func (s *Styles) Views() Views
- func (s *Styles) Xray() Xray
- type Table
- type TableHeader
- type Threshold
- type Title
- type UI
- type ViewConfigListener
- type ViewSetting
- type Views
- type Xray
- type Yaml
Constants ¶
const ( // DefaultC default concurrency. DefaultC = 1 // DefaultN default number of requests. DefaultN = 200 // DefaultMethod default http verb. DefaultMethod = "GET" )
const ( // K9sEnvConfigDir represents k9s configuration dir env var. K9sEnvConfigDir = "K9S_CONFIG_DIR" // K9sEnvLogsDir represents k9s logs dir env var. K9sEnvLogsDir = "K9S_LOGS_DIR" // AppName tracks k9s app name. AppName = "k9s" K9sLogsFile = "k9s.log" )
const ( // DefaultRefreshRate represents the refresh interval. DefaultRefreshRate = 2 // secs // DefaultLogLevel represents the default log level. DefaultLogLevel = "info" // DefaultCommand represents the default command to run. DefaultCommand = "" )
const ( // DefaultLoggerTailCount tracks default log tail size. DefaultLoggerTailCount = 100 // MaxLogThreshold sets the max value for log size. MaxLogThreshold = 5000 // DefaultSinceSeconds tracks default log age. DefaultSinceSeconds = -1 // tail logs by default )
Variables ¶
var ( // AppConfigDir tracks main k9s config home directory. AppConfigDir string // AppSkinsDir tracks skins data directory. AppSkinsDir string // AppBenchmarksDir tracks benchmarks results directory. AppBenchmarksDir string // AppDumpsDir tracks screen dumps data directory. AppDumpsDir string // AppContextsDir tracks contexts data directory. AppContextsDir string // AppConfigFile tracks k9s config file. AppConfigFile string // AppLogFile tracks k9s logs file. AppLogFile string // AppViewsFile tracks custom views config file. AppViewsFile string // AppAliasesFile tracks aliases config file. AppAliasesFile string // AppPluginsFile tracks plugins config file. AppPluginsFile string // AppHotKeysFile tracks hotkeys config file. AppHotKeysFile string )
var K9sBench = "bench"
K9sBench the name of the benchmarks config file.
Functions ¶
func AppContextAliasesFile ¶ added in v0.30.0
AppContextAliasesFile generates a valid context specific aliases file path.
func AppContextConfig ¶ added in v0.30.0
AppContextConfig generates a valid context config file path.
func AppContextDir ¶ added in v0.30.0
AppContextDir generates a valid context config dir.
func AppContextHotkeysFile ¶ added in v0.30.0
AppContextHotkeysFile generates a valid context specific hotkeys file path.
func AppContextPluginsFile ¶ added in v0.30.0
AppContextPluginsFile generates a valid context specific plugins file path.
func EnsureAliasesCfgFile ¶ added in v0.30.0
EnsureAliasesCfgFile generates a valid aliases file.
func EnsureBenchmarksCfgFile ¶ added in v0.30.0
EnsureBenchmarksCfgFile generates a valid benchmark file.
func EnsureBenchmarksDir ¶ added in v0.30.0
EnsureBenchmarksDir generates a valid benchmark results directory.
func EnsureHotkeysCfgFile ¶ added in v0.30.0
EnsureHotkeysCfgFile generates a valid hotkeys file.
func InitLocs ¶ added in v0.30.0
func InitLocs() error
InitLocs initializes k9s artifacts locations.
func InitLogLoc ¶ added in v0.30.0
func InitLogLoc() error
InitLogLoc initializes K9s logs location.
func SkinFileFromName ¶ added in v0.30.0
SkinFileFromName generate skin file path from spec.
func UserTmpDir ¶ added in v0.30.5
UserTmpDir returns the temp dir with the current user name.
Types ¶
type Aliases ¶
type Aliases struct { Alias Alias `yaml:"aliases"` // contains filtered or unexported fields }
Aliases represents a collection of aliases.
func (*Aliases) AliasesFor ¶ added in v0.31.9
func (*Aliases) SaveAliases ¶
SaveAliases saves aliases to a given file.
func (*Aliases) ShortNames ¶ added in v0.13.8
func (a *Aliases) ShortNames() ShortNames
ShortNames return all shortnames.
type Bench ¶
type Bench struct {
Benchmarks *Benchmarks `yaml:"benchmarks"`
}
Bench tracks K9s styling options.
type BenchConfig ¶
type BenchConfig struct { Name string C int `yaml:"concurrency"` N int `yaml:"requests"` Auth Auth `yaml:"auth"` HTTP HTTP `yaml:"http"` }
BenchConfig represents a service benchmark.
func DefaultBenchSpec ¶ added in v0.15.2
func DefaultBenchSpec() BenchConfig
DefaultBenchSpec returns a default bench spec.
type Benchmarks ¶
type Benchmarks struct { Defaults Benchmark `yaml:"defaults"` Services map[string]BenchConfig `yam':"services"` Containers map[string]BenchConfig `yam':"containers"` }
Benchmarks tracks K9s benchmarks configuration.
type Body ¶
type Body struct { FgColor Color `json:"fgColor" yaml:"fgColor"` BgColor Color `json:"bgColor" yaml:"bgColor"` LogoColor Color `json:"logoColor" yaml:"logoColor"` LogoColorMsg Color `json:"logoColorMsg" yaml:"logoColorMsg"` LogoColorInfo Color `json:"logoColorInfo" yaml:"logoColorInfo"` LogoColorWarn Color `json:"logoColorWarn" yaml:"logoColorWarn"` LogoColorError Color `json:"logoColorError" yaml:"logoColorError"` }
Body tracks body styles.
type Border ¶
type Border struct { FgColor Color `json:"fgColor" yaml:"fgColor"` FocusColor Color `json:"focusColor" yaml:"focusColor"` }
Border tracks border styles.
type Charts ¶ added in v0.16.0
type Charts struct { BgColor Color `json:"bgColor" yaml:"bgColor"` DialBgColor Color `json:"dialBgColor" yaml:"dialBgColor"` ChartBgColor Color `json:"chartBgColor" yaml:"chartBgColor"` DefaultDialColors Colors `json:"defaultDialColors" yaml:"defaultDialColors"` DefaultChartColors Colors `json:"defaultChartColors" yaml:"defaultChartColors"` ResourceColors map[string]Colors `json:"resourceColors" yaml:"resourceColors"` }
Charts tracks charts styles.
type Color ¶ added in v0.16.0
type Color string
Color represents a color.
type Config ¶
type Config struct { K9s *K9s `yaml:"k9s" json:"k9s"` // contains filtered or unexported fields }
Config tracks K9s configuration options.
func NewConfig ¶
func NewConfig(ks data.KubeSettings) *Config
NewConfig creates a new default config.
func (*Config) ActiveContextName ¶ added in v0.30.0
func (*Config) ActiveNamespace ¶
ActiveNamespace returns the active namespace in the current context. If none found return the empty ns.
func (*Config) ActiveView ¶
ActiveView returns the active view in the current context.
func (*Config) ContextAliasesPath ¶ added in v0.30.0
ContextAliasesPath returns a context specific aliases file spec.
func (*Config) ContextHotkeysPath ¶ added in v0.31.0
ContextHotkeysPath returns a context specific hotkeys file spec.
func (*Config) ContextPluginsPath ¶ added in v0.30.0
ContextPluginsPath returns a context specific plugins file spec.
func (*Config) CurrentContext ¶ added in v0.30.0
CurrentContext fetch the configuration active context.
func (*Config) FavNamespaces ¶
FavNamespaces returns fav namespaces in the current context.
func (*Config) GetConnection ¶
func (c *Config) GetConnection() client.Connection
GetConnection return an api server connection.
func (*Config) Refine ¶
func (c *Config) Refine(flags *genericclioptions.ConfigFlags, k9sFlags *Flags, cfg *client.Config) error
Refine the configuration based on cli args.
func (*Config) Reset ¶
func (c *Config) Reset()
Reset resets the context to the new current context/cluster.
func (*Config) SetActiveNamespace ¶
SetActiveNamespace set the active namespace in the current context.
func (*Config) SetActiveView ¶
SetActiveView sets current context active view.
func (*Config) SetConnection ¶
func (c *Config) SetConnection(conn client.Connection)
SetConnection set an api server connection.
func (*Config) SetCurrentContext ¶ added in v0.30.0
type Crumb ¶
type Crumb struct { FgColor Color `json:"fgColor" yaml:"fgColor"` BgColor Color `json:"bgColor" yaml:"bgColor"` ActiveColor Color `json:"activeColor" yaml:"activeColor"` }
Crumb tracks crumbs styles.
type CustomView ¶ added in v0.17.0
type CustomView struct { Views map[string]ViewSetting `yaml:"views"` // contains filtered or unexported fields }
CustomView represents a collection of view customization.
func NewCustomView ¶ added in v0.17.0
func NewCustomView() *CustomView
NewCustomView returns a views configuration.
func (*CustomView) AddListener ¶ added in v0.17.0
func (v *CustomView) AddListener(gvr string, l ViewConfigListener)
AddListener registers a new listener.
func (*CustomView) Load ¶ added in v0.17.0
func (v *CustomView) Load(path string) error
Load loads view configurations.
func (*CustomView) RemoveListener ¶ added in v0.17.0
func (v *CustomView) RemoveListener(gvr string)
RemoveListener unregister a listener.
func (*CustomView) Reset ¶ added in v0.17.0
func (v *CustomView) Reset()
Reset clears out configurations.
type Dialog ¶ added in v0.21.6
type Dialog struct { FgColor Color `json:"fgColor" yaml:"fgColor"` BgColor Color `json:"bgColor" yaml:"bgColor"` ButtonFgColor Color `json:"buttonFgColor" yaml:"buttonFgColor"` ButtonBgColor Color `json:"buttonBgColor" yaml:"buttonBgColor"` ButtonFocusFgColor Color `json:"buttonFocusFgColor" yaml:"buttonFocusFgColor"` ButtonFocusBgColor Color `json:"buttonFocusBgColor" yaml:"buttonFocusBgColor"` LabelFgColor Color `json:"labelFgColor" yaml:"labelFgColor"` FieldFgColor Color `json:"fieldFgColor" yaml:"fieldFgColor"` }
Dialog tracks dialog styles.
type Flags ¶
type Flags struct { RefreshRate *int LogLevel *string LogFile *string Headless *bool Logoless *bool Command *string AllNamespaces *bool ReadOnly *bool Write *bool Crumbsless *bool ScreenDumpDir *string }
Flags represents K9s configuration flags.
type Frame ¶
type Frame struct { Title Title `json:"title" yaml:"title"` Border Border `json:"border" yaml:"border"` Menu Menu `json:"menu" yaml:"menu"` Crumb Crumb `json:"crumbs" yaml:"crumbs"` Status Status `json:"status" yaml:"status"` }
Frame tracks frame styles.
type HTTP ¶
type HTTP struct { Method string `yaml:"method"` Host string `yaml:"host"` Path string `yaml:"path"` HTTP2 bool `yaml:"http2"` Body string `yaml:"body"` Headers http.Header `yaml:"headers"` }
HTTP represents an http request.
type Help ¶ added in v0.24.9
type Help struct { FgColor Color `json:"fgColor" yaml:"fgColor"` BgColor Color `json:"bgColor" yaml:"bgColor"` SectionColor Color `json:"sectionColor" yaml:"sectionColor"` KeyColor Color `json:"keyColor" yaml:"keyColor"` NumKeyColor Color `json:"numKeyColor" yaml:"numKeyColor"` }
Help tracks help styles.
type HotKey ¶
type HotKey struct { ShortCut string `yaml:"shortCut"` Override bool `yaml:"override"` Description string `yaml:"description"` Command string `yaml:"command"` KeepHistory bool `yaml:"keepHistory"` }
HotKey describes a K9s hotkey.
type HotKeys ¶
HotKeys represents a collection of plugins.
func (HotKeys) LoadHotKeys ¶
LoadHotKeys loads plugins from a given file.
type ImageScans ¶ added in v0.30.0
type ImageScans struct { Enable bool `json:"enable" yaml:"enable"` Exclusions ScanExcludes `json:"exclusions" yaml:"exclusions"` }
ImageScans tracks vul scans options.
func NewImageScans ¶ added in v0.30.0
func NewImageScans() ImageScans
NewImageScans returns a new instance.
func (ImageScans) ShouldExclude ¶ added in v0.30.0
func (i ImageScans) ShouldExclude(ns string, ll map[string]string) bool
ShouldExclude checks if scan should be excluder given ns/labels
type Info ¶
type Info struct { SectionColor Color `json:"sectionColor" yaml:"sectionColor"` FgColor Color `json:"fgColor" yaml:"fgColor"` }
Info tracks info styles.
type K9s ¶
type K9s struct { LiveViewAutoRefresh bool `json:"liveViewAutoRefresh" yaml:"liveViewAutoRefresh"` ScreenDumpDir string `json:"screenDumpDir" yaml:"screenDumpDir,omitempty"` RefreshRate int `json:"refreshRate" yaml:"refreshRate"` MaxConnRetry int `json:"maxConnRetry" yaml:"maxConnRetry"` ReadOnly bool `json:"readOnly" yaml:"readOnly"` NoExitOnCtrlC bool `json:"noExitOnCtrlC" yaml:"noExitOnCtrlC"` UI UI `json:"ui" yaml:"ui"` SkipLatestRevCheck bool `json:"skipLatestRevCheck" yaml:"skipLatestRevCheck"` DisablePodCounting bool `json:"disablePodCounting" yaml:"disablePodCounting"` ShellPod ShellPod `json:"shellPod" yaml:"shellPod"` ImageScans ImageScans `json:"imageScans" yaml:"imageScans"` Logger Logger `json:"logger" yaml:"logger"` Thresholds Threshold `json:"thresholds" yaml:"thresholds"` // contains filtered or unexported fields }
K9s tracks K9s configuration options.
func NewK9s ¶
func NewK9s(conn client.Connection, ks data.KubeSettings) *K9s
NewK9s create a new K9s configuration.
func (*K9s) ActivateContext ¶ added in v0.30.0
ActivateContext initializes the active context if not present.
func (*K9s) ActiveContext ¶ added in v0.30.0
ActiveContext returns the currently active context.
func (*K9s) ActiveContextName ¶ added in v0.30.0
ActiveContextName returns the active context name.
func (*K9s) ActiveContextNamespace ¶ added in v0.30.0
ActiveContextNamespace fetch the context active ns.
func (*K9s) AppScreenDumpDir ¶ added in v0.31.0
AppScreenDumpDir fetch screen dumps dir.
func (*K9s) ContextScreenDumpDir ¶ added in v0.31.0
ContextScreenDumpDir fetch context specific screen dumps dir.
func (*K9s) GetRefreshRate ¶
GetRefreshRate returns the current refresh rate.
func (*K9s) IsCrumbsless ¶ added in v0.23.0
IsCrumbsless returns crumbsless setting.
func (*K9s) IsHeadless ¶ added in v0.23.0
IsHeadless returns headless setting.
func (*K9s) IsLogoless ¶ added in v0.24.3
IsLogoless returns logoless setting.
func (*K9s) IsReadOnly ¶ added in v0.23.0
IsReadOnly returns the readonly setting.
func (*K9s) Validate ¶
func (k *K9s) Validate(c client.Connection, ks data.KubeSettings)
Validate the current configuration.
type Limits ¶ added in v0.19.5
type Limits map[v1.ResourceName]string
Limits represents resource limits.
type Log ¶
type Log struct { FgColor Color `json:"fgColor" yaml:"fgColor"` BgColor Color `json:"bgColor" yaml:"bgColor"` Indicator LogIndicator `json:"indicator" yaml:"indicator"` }
Log tracks Log styles.
type LogIndicator ¶ added in v0.18.0
type LogIndicator struct { FgColor Color `json:"fgColor" yaml:"fgColor"` BgColor Color `json:"bgColor" yaml:"bgColor"` ToggleOnColor Color `json:"toggleOnColor" yaml:"toggleOnColor"` ToggleOffColor Color `json:"toggleOffColor" yaml:"toggleOffColor"` }
LogIndicator tracks log view indicator.
type Logger ¶ added in v0.18.0
type Logger struct { TailCount int64 `json:"tail" yaml:"tail"` BufferSize int `json:"buffer" yaml:"buffer"` SinceSeconds int64 `json:"sinceSeconds" yaml:"sinceSeconds"` TextWrap bool `json:"textWrap" yaml:"textWrap"` ShowTime bool `json:"showTime" yaml:"showTime"` }
Logger tracks logger options.
type Menu ¶
type Menu struct { FgColor Color `json:"fgColor" yaml:"fgColor"` KeyColor Color `json:"keyColor" yaml:"keyColor"` NumKeyColor Color `json:"numKeyColor" yaml:"numKeyColor"` }
Menu tracks menu styles.
type Picker ¶ added in v0.29.0
type Picker struct { MainColor Color `json:"mainColor" yaml:"mainColor"` FocusColor Color `json:"focusColor" yaml:"focusColor"` ShortcutColor Color `json:"shortcutColor" yaml:"shortcutColor"` }
Picker tracks color when selecting containers
type Plugin ¶
type Plugin struct { Scopes []string `yaml:"scopes"` Args []string `yaml:"args"` ShortCut string `yaml:"shortCut"` Override bool `yaml:"override"` Pipes []string `yaml:"pipes"` Description string `yaml:"description"` Command string `yaml:"command"` Confirm bool `yaml:"confirm"` Background bool `yaml:"background"` Dangerous bool `yaml:"dangerous"` }
Plugin describes a K9s plugin.
type Prompt ¶ added in v0.24.12
type Prompt struct { FgColor Color `json:"fgColor" yaml:"fgColor"` BgColor Color `json:"bgColor" yaml:"bgColor"` SuggestColor Color `json:"" yaml:"suggestColor"` Border PromptBorder `json:"" yaml:"border"` }
Prompt tracks command styles
type PromptBorder ¶ added in v0.28.1
type PromptBorder struct { CommandColor Color `json:"command" yaml:"command"` DefaultColor Color `json:"default" yaml:"default"` }
PromptBorder tracks the color of the prompt depending on its kind (e.g., command or filter)
type ScanExcludes ¶ added in v0.30.2
type ScanExcludes struct { Namespaces []string `json:"namespaces" yaml:"namespaces"` Labels Labels `json:"labels" yaml:"labels"` }
ScanExcludes tracks vul scan exclusions.
type Severity ¶ added in v0.17.5
Severity tracks a resource severity levels.
func NewSeverity ¶ added in v0.17.5
func NewSeverity() *Severity
NewSeverity returns a new instance.
type SeverityLevel ¶ added in v0.17.5
type SeverityLevel int
SeverityLevel tracks severity levels.
const ( // SeverityLow tracks low severity. SeverityLow SeverityLevel = iota // SeverityMedium tracks medium severity level. SeverityMedium // SeverityHigh tracks high severity level. SeverityHigh )
type ShellPod ¶ added in v0.19.5
type ShellPod struct { Image string `json:"image" yaml:"image"` Command []string `json:"command,omitempty" yaml:"command,omitempty"` Args []string `json:"args,omitempty" yaml:"args,omitempty"` Namespace string `json:"namespace" yaml:"namespace"` Limits Limits `json:"limits,omitempty" yaml:"limits,omitempty"` Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` ImagePullSecrets []v1.LocalObjectReference `json:"imagePullSecrets,omitempty" yaml:"imagePullSecrets,omitempty"` ImagePullPolicy v1.PullPolicy `json:"imagePullPolicy,omitempty" yaml:"imagePullPolicy,omitempty"` TTY bool `json:"tty,omitempty" yaml:"tty,omitempty"` }
ShellPod represents k9s shell configuration.
type ShortNames ¶
ShortNames represents a collection of shortnames for aliases.
type Status ¶
type Status struct { NewColor Color `json:"newColor" yaml:"newColor"` ModifyColor Color `json:"modifyColor" yaml:"modifyColor"` AddColor Color `json:"addColor" yaml:"addColor"` PendingColor Color `json:"pendingColor" yaml:"pendingColor"` ErrorColor Color `json:"errorColor" yaml:"errorColor"` HighlightColor Color `json:"highlightColor" yaml:"highlightColor"` KillColor Color `json:"killColor" yaml:"killColor"` CompletedColor Color `json:"completedColor" yaml:"completedColor"` }
Status tracks resource status styles.
type Style ¶
type Style struct { Body Body `json:"body" yaml:"body"` Prompt Prompt `json:"prompt" yaml:"prompt"` Help Help `json:"help" yaml:"help"` Frame Frame `json:"frame" yaml:"frame"` Info Info `json:"info" yaml:"info"` Views Views `json:"views" yaml:"views"` Dialog Dialog `json:"dialog" yaml:"dialog"` }
Style tracks K9s styles.
type StyleListener ¶
type StyleListener interface { // StylesChanged notifies listener the skin changed. StylesChanged(*Styles) }
StyleListener represents a skin's listener.
type Styles ¶
type Styles struct { K9s Style `json:"k9s" yaml:"k9s"` // contains filtered or unexported fields }
Styles tracks K9s styling options.
func (*Styles) AddListener ¶
func (s *Styles) AddListener(l StyleListener)
AddListener registers a new listener.
func (*Styles) BgColor ¶
func (s *Styles) BgColor() tcell.Color
BgColor returns the background color.
func (*Styles) FgColor ¶
func (s *Styles) FgColor() tcell.Color
FgColor returns the foreground color.
func (*Styles) RemoveListener ¶
func (s *Styles) RemoveListener(l StyleListener)
RemoveListener removes a listener.
type Table ¶
type Table struct { FgColor Color `json:"fgColor" yaml:"fgColor"` BgColor Color `json:"bgColor" yaml:"bgColor"` CursorFgColor Color `json:"cursorFgColor" yaml:"cursorFgColor"` CursorBgColor Color `json:"cursorBgColor" yaml:"cursorBgColor"` MarkColor Color `json:"markColor" yaml:"markColor"` Header TableHeader `json:"header" yaml:"header"` }
Table tracks table styles.
type TableHeader ¶
type TableHeader struct { FgColor Color `json:"fgColor" yaml:"fgColor"` BgColor Color `json:"bgColor" yaml:"bgColor"` SorterColor Color `json:"sorterColor" yaml:"sorterColor"` }
TableHeader tracks table header styles.
type Threshold ¶ added in v0.17.4
Threshold tracks threshold to alert user when excided.
func NewThreshold ¶ added in v0.17.5
func NewThreshold() Threshold
NewThreshold returns a new threshold.
func (Threshold) LevelFor ¶ added in v0.17.5
func (t Threshold) LevelFor(k string, v int) SeverityLevel
LevelFor returns a defcon level for the current state.
func (*Threshold) SeverityColor ¶ added in v0.17.5
SeverityColor returns an defcon level associated level.
type Title ¶
type Title struct { FgColor Color `json:"fgColor" yaml:"fgColor"` BgColor Color `json:"bgColor" yaml:"bgColor"` HighlightColor Color `json:"highlightColor" yaml:"highlightColor"` CounterColor Color `json:"counterColor" yaml:"counterColor"` FilterColor Color `json:"filterColor" yaml:"filterColor"` }
Title tracks title styles.
type UI ¶ added in v0.30.0
type UI struct { // EnableMouse toggles mouse support. EnableMouse bool `json:"enableMouse" yaml:"enableMouse"` // Headless toggles top header display. Headless bool `json:"headless" yaml:"headless"` // LogoLess toggles k9s logo. Logoless bool `json:"logoless" yaml:"logoless"` // Crumbsless toggles nav crumb display. Crumbsless bool `json:"crumbsless" yaml:"crumbsless"` // Reactive toggles reactive ui changes. Reactive bool `json:"reactive" yaml:"reactive"` // NoIcons toggles icons display. NoIcons bool `json:"noIcons" yaml:"noIcons"` // Skin reference the general k9s skin name. // Can be overridden per context. Skin string `json:"skin" yaml:"skin,omitempty"` // DefaultsToFullScreen toggles fullscreen on views like logs, yaml, details. DefaultsToFullScreen bool `json:"defaultsToFullScreen" yaml:"defaultsToFullScreen"` }
UI tracks ui specific configs.
type ViewConfigListener ¶ added in v0.17.0
type ViewConfigListener interface { // ViewSettingsChanged notifies listener the view configuration changed. ViewSettingsChanged(ViewSetting) }
ViewConfigListener represents a view config listener.
type ViewSetting ¶ added in v0.17.0
ViewSetting represents a view configuration.
func (*ViewSetting) HasCols ¶ added in v0.32.0
func (v *ViewSetting) HasCols() bool
func (*ViewSetting) IsBlank ¶ added in v0.32.0
func (v *ViewSetting) IsBlank() bool
type Views ¶
type Views struct { Table Table `json:"table" yaml:"table"` Xray Xray `json:"xray" yaml:"xray"` Charts Charts `json:"charts" yaml:"charts"` Yaml Yaml `json:"yaml" yaml:"yaml"` Picker Picker `json:"picker" yaml:"picker"` Log Log `json:"logs" yaml:"logs"` }
Views tracks individual view styles.
type Xray ¶ added in v0.13.3
type Xray struct { FgColor Color `json:"fgColor" yaml:"fgColor"` BgColor Color `json:"bgColor" yaml:"bgColor"` CursorColor Color `json:"cursorColor" yaml:"cursorColor"` CursorTextColor Color `json:"cursorTextColor" yaml:"cursorTextColor"` GraphicColor Color `json:"graphicColor" yaml:"graphicColor"` }
Xray tracks xray styles.