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 K9sHome() string
- func MustK9sUser() string
- func SkinFileFromName(n string) string
- func YamlExtension(path string) string
- type Alias
- type Aliases
- 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) ContextPluginsPath() string
- 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) error
- func (c *Config) Refine(flags *genericclioptions.ConfigFlags, k9sFlags *Flags, cfg *client.Config) error
- func (c *Config) Reset()
- func (c *Config) Save() 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()
- func (c *Config) ValidateFavorites()
- 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) ActiveContextDir() string
- func (k *K9s) ActiveContextName() string
- func (k *K9s) ActiveContextNamespace() (string, error)
- func (k *K9s) ActiveScreenDumpsDir() string
- func (k *K9s) GetRefreshRate() int
- func (k *K9s) GetScreenDumpDir() string
- func (k *K9s) IsCrumbsless() bool
- func (k *K9s) IsHeadless() bool
- func (k *K9s) IsLogoless() bool
- func (k *K9s) IsReadOnly() bool
- func (k *K9s) Override(k9sFlags *Flags)
- func (k *K9s) OverrideCommand(cmd string)
- func (k *K9s) OverrideCrumbsless(b bool)
- func (k *K9s) OverrideHeadless(b bool)
- func (k *K9s) OverrideLogoless(b bool)
- func (k *K9s) OverrideReadOnly(b bool)
- func (k *K9s) OverrideRefreshRate(r int)
- func (k *K9s) OverrideScreenDumpDir(dir string)
- func (k *K9s) OverrideWrite(b bool)
- func (k *K9s) Refine(k1 *K9s)
- func (k *K9s) Reset()
- func (k *K9s) Save() 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) DefaultSkin()
- func (s *Styles) Dialog() Dialog
- 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 ViewSettings
- 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 ( // K9sConfigDir represents k9s configuration dir env var. K9sConfigDir = "K9S_CONFIG_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
InitLogsLoc initializes K9s logs location.
func SkinFileFromName ¶ added in v0.30.0
SkinFileFromName generate skin file path from spec.
func YamlExtension ¶ added in v0.29.0
YamlExtension tries to find the correct extension for a YAML file
Types ¶
type Aliases ¶
type Aliases struct { Alias Alias `yaml:"aliases"` // contains filtered or unexported fields }
Aliases represents a collection of aliases.
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 `yaml:"fgColor"` BgColor Color `yaml:"bgColor"` LogoColor Color `yaml:"logoColor"` LogoColorMsg Color `yaml:"logoColorMsg"` LogoColorInfo Color `yaml:"logoColorInfo"` LogoColorWarn Color `yaml:"logoColorWarn"` LogoColorError Color `yaml:"logoColorError"` }
Body tracks body styles.
type Charts ¶ added in v0.16.0
type Charts struct { BgColor Color `yaml:"bgColor"` DialBgColor Color `yaml:"dialBgColor"` ChartBgColor Color `yaml:"chartBgColor"` DefaultDialColors Colors `yaml:"defaultDialColors"` DefaultChartColors Colors `yaml:"defaultChartColors"` ResourceColors map[string]Colors `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"` // 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) 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
func (*Config) ValidateFavorites ¶ added in v0.19.4
func (c *Config) ValidateFavorites()
ValidateFavorites ensure favorite ns are legit.
type Crumb ¶
type Crumb struct { FgColor Color `yaml:"fgColor"` BgColor Color `yaml:"bgColor"` ActiveColor Color `yaml:"activeColor"` }
Crumb tracks crumbs styles.
type CustomView ¶ added in v0.17.0
type CustomView struct { K9s ViewSettings `yaml:"k9s"` // 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 `yaml:"fgColor"` BgColor Color `yaml:"bgColor"` ButtonFgColor Color `yaml:"buttonFgColor"` ButtonBgColor Color `yaml:"buttonBgColor"` ButtonFocusFgColor Color `yaml:"buttonFocusFgColor"` ButtonFocusBgColor Color `yaml:"buttonFocusBgColor"` LabelFgColor Color `yaml:"labelFgColor"` FieldFgColor Color `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 `yaml:"title"` Border Border `yaml:"border"` Menu Menu `yaml:"menu"` Crumb Crumb `yaml:"crumbs"` Status 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 `yaml:"fgColor"` BgColor Color `yaml:"bgColor"` SectionColor Color `yaml:"sectionColor"` KeyColor Color `yaml:"keyColor"` NumKeyColor Color `yaml:"numKeyColor"` }
Help tracks help styles.
type HotKey ¶
type HotKey struct { ShortCut string `yaml:"shortCut"` Description string `yaml:"description"` Command string `yaml:"command"` }
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 `yaml:"enable"` Exclusions ScanExcludes `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 K9s ¶
type K9s struct { LiveViewAutoRefresh bool `yaml:"liveViewAutoRefresh"` ScreenDumpDir string `yaml:"screenDumpDir,omitempty"` RefreshRate int `yaml:"refreshRate"` MaxConnRetry int `yaml:"maxConnRetry"` ReadOnly bool `yaml:"readOnly"` NoExitOnCtrlC bool `yaml:"noExitOnCtrlC"` UI UI `yaml:"ui"` SkipLatestRevCheck bool `yaml:"skipLatestRevCheck"` DisablePodCounting bool `yaml:"disablePodCounting"` ShellPod *ShellPod `yaml:"shellPod"` ImageScans *ImageScans `yaml:"imageScans"` Logger *Logger `yaml:"logger"` Thresholds Threshold `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 is not present.
func (*K9s) ActiveContext ¶ added in v0.30.0
ActiveContext returns the currently active context.
func (*K9s) ActiveContextDir ¶ added in v0.30.0
ActiveContextDir fetch current cluster/context path.
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) ActiveScreenDumpsDir ¶ added in v0.30.3
ActiveScreenDumpsDir fetch context specific screen dumps dir.
func (*K9s) GetRefreshRate ¶
GetRefreshRate returns the current refresh rate.
func (*K9s) GetScreenDumpDir ¶ added in v0.25.9
GetScreenDumpDir fetch screen dumps dir.
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) OverrideCommand ¶
OverrideCommand set the command manually.
func (*K9s) OverrideCrumbsless ¶ added in v0.23.0
OverrideCrumbsless tooh the crumbslessness manually.
func (*K9s) OverrideHeadless ¶
OverrideHeadless toggle the header manually.
func (*K9s) OverrideLogoless ¶ added in v0.24.3
OverrideLogoless toggle the k9s logo manually.
func (*K9s) OverrideReadOnly ¶ added in v0.13.8
OverrideReadOnly set the readonly mode manually.
func (*K9s) OverrideRefreshRate ¶
OverrideRefreshRate set the refresh rate manually.
func (*K9s) OverrideScreenDumpDir ¶ added in v0.25.9
OverrideScreenDumpDir set the screen dump dir manually.
func (*K9s) OverrideWrite ¶ added in v0.23.2
OverrideWrite set the write mode manually.
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 `yaml:"fgColor"` BgColor Color `yaml:"bgColor"` Indicator LogIndicator `yaml:"indicator"` }
Log tracks Log styles.
type LogIndicator ¶ added in v0.18.0
type LogIndicator struct { FgColor Color `yaml:"fgColor"` BgColor Color `yaml:"bgColor"` ToggleOnColor Color `yaml:"toggleOnColor"` ToggleOffColor Color `yaml:"toggleOffColor"` }
LogIndicator tracks log view indicator.
type Logger ¶ added in v0.18.0
type Logger struct { TailCount int64 `yaml:"tail"` BufferSize int `yaml:"buffer"` SinceSeconds int64 `yaml:"sinceSeconds"` FullScreenLogs bool `yaml:"fullScreenLogs"` TextWrap bool `yaml:"textWrap"` ShowTime bool `yaml:"showTime"` }
Logger tracks logger options.
func (*Logger) Validate ¶ added in v0.18.0
func (l *Logger) Validate(_ client.Connection, _ data.KubeSettings)
Validate checks thresholds and make sure we're cool. If not use defaults.
type Menu ¶
type Menu struct { FgColor Color `yaml:"fgColor"` KeyColor Color `yaml:"keyColor"` NumKeyColor Color `yaml:"numKeyColor"` }
Menu tracks menu styles.
type Picker ¶ added in v0.29.0
type Picker struct { MainColor Color `yaml:"mainColor"` FocusColor Color `yaml:"focusColor"` ShortcutColor Color `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"` Pipes []string `yaml:"pipes"` Description string `yaml:"description"` Command string `yaml:"command"` Confirm bool `yaml:"confirm"` Background bool `yaml:"background"` }
Plugin describes a K9s plugin.
type Prompt ¶ added in v0.24.12
type Prompt struct { FgColor Color `yaml:"fgColor"` BgColor Color `yaml:"bgColor"` SuggestColor Color `yaml:"suggestColor"` Border PromptBorder `yaml:"border"` }
Prompt tracks command styles
type PromptBorder ¶ added in v0.28.1
type PromptBorder struct { CommandColor Color `yaml:"command"` DefaultColor Color `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
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 `yaml:"image"` Command []string `yaml:"command,omitempty"` Args []string `yaml:"args,omitempty"` Namespace string `yaml:"namespace"` Limits Limits `yaml:"limits,omitempty"` Labels map[string]string `yaml:"labels,omitempty"` ImagePullSecrets []v1.LocalObjectReference `yaml:"imagePullSecrets,omitempty"` ImagePullPolicy v1.PullPolicy `yaml:"imagePullPolicy,omitempty"` TTY bool `yaml:"tty,omitempty"` }
ShellPod represents k9s shell configuration.
func NewShellPod ¶ added in v0.19.5
func NewShellPod() *ShellPod
NewShellPod returns a new instance.
func (*ShellPod) Validate ¶ added in v0.19.5
func (s *ShellPod) Validate(client.Connection, data.KubeSettings)
Validate validates the configuration.
type ShortNames ¶
ShortNames represents a collection of shortnames for aliases.
type Status ¶
type Status struct { NewColor Color `yaml:"newColor"` ModifyColor Color `yaml:"modifyColor"` AddColor Color `yaml:"addColor"` PendingColor Color `yaml:"pendingColor"` ErrorColor Color `yaml:"errorColor"` HighlightColor Color `yaml:"highlightColor"` KillColor Color `yaml:"killColor"` CompletedColor Color `yaml:"completedColor"` }
Status tracks resource status styles.
type Style ¶
type Style struct { Body Body `yaml:"body"` Prompt Prompt `yaml:"prompt"` Help Help `yaml:"help"` Frame Frame `yaml:"frame"` Info Info `yaml:"info"` Views Views `yaml:"views"` Dialog 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 `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) DefaultSkin ¶ added in v0.15.0
func (s *Styles) DefaultSkin()
DefaultSkin loads the default skin.
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 `yaml:"fgColor"` BgColor Color `yaml:"bgColor"` CursorFgColor Color `yaml:"cursorFgColor"` CursorBgColor Color `yaml:"cursorBgColor"` MarkColor Color `yaml:"markColor"` Header TableHeader `yaml:"header"` }
Table tracks table styles.
type TableHeader ¶
type TableHeader struct { FgColor Color `yaml:"fgColor"` BgColor Color `yaml:"bgColor"` SorterColor Color `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.
func (Threshold) Validate ¶ added in v0.17.4
func (t Threshold) Validate(c client.Connection, ks data.KubeSettings)
Validate a namespace is setup correctly.
type Title ¶
type Title struct { FgColor Color `yaml:"fgColor"` BgColor Color `yaml:"bgColor"` HighlightColor Color `yaml:"highlightColor"` CounterColor Color `yaml:"counterColor"` FilterColor Color `yaml:"filterColor"` }
Title tracks title styles.
type UI ¶ added in v0.30.0
type UI struct { // EnableMouse toggles mouse support. EnableMouse bool `yaml:"enableMouse"` // Headless toggles top header display. Headless bool `yaml:"headless"` // LogoLess toggles k9s logo. Logoless bool `yaml:"logoless"` // Crumbsless toggles nav crumb display. Crumbsless bool `yaml:"crumbsless"` // NoIcons toggles icons display. NoIcons bool `yaml:"noIcons"` // Skin reference the general k9s skin name. // Can be overridden per context. Skin string `yaml:"skin,omitempty"` }
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.
type ViewSettings ¶ added in v0.17.0
type ViewSettings struct {
Views map[string]ViewSetting `yaml:"views"`
}
ViewSettings represent a collection of view configurations.
func NewViewSettings ¶ added in v0.17.0
func NewViewSettings() ViewSettings
NewViewSettings returns a new configuration.
type Views ¶
type Views struct { Table Table `yaml:"table"` Xray Xray `yaml:"xray"` Charts Charts `yaml:"charts"` Yaml Yaml `yaml:"yaml"` Picker Picker `yaml:"picker"` Log Log `yaml:"logs"` }
Views tracks individual view styles.