Documentation
¶
Index ¶
Constants ¶
View Source
const ( CommandGroupInfo = "Info" CommandGroupKubesel = "Kubesel" CommandGroupKubeconfig = "Kubeconfig" )
View Source
const ( ExitCodeOK = 0 ExitCodeError = 1 ExitCodeHelp = 10 ExitCodeCancelled = 130 )
Variables ¶
View Source
var ( // Kubesel is the global instance of [kubesel.Kubesel] used by all // subcommands. Kubesel = sync.OnceValues(kubesel.NewKubesel) // Kubectl is the global instance of the [kubectl.Kubectl] wrapper used by // all subcommands. Kubectl = sync.OnceValues(kubectl.NewKubectlFromPATH) )
View Source
var ( ErrUnknownFormat = errors.New("unknown output format") ErrFormatNoOptions = errors.New("format does not take options") ErrFormatNeedsOptions = errors.New("format requires options") )
View Source
var ClusterCommandOptions struct {
}
View Source
var ContextCommandOptions struct { KeepNamespace bool }
View Source
var GCCommandOptions struct {
}
View Source
var GlobalOptions struct { Debug bool // --debug (hidden flag) Color bool // --color OutputIsTTY bool // not a flag }
View Source
var InitCommandOptions struct { KubeconfigFiles []string }
View Source
var ListCommandOptions struct { OutputFormat OutputFormat }
View Source
var NamespaceCommandOptions struct {
}
View Source
var RootCommand = cobra.Command{ Use: filepath.Base(os.Args[0]), CompletionOptions: cobra.CompletionOptions{ HiddenDefaultCmd: initScriptLoadsCompletions, }, SilenceErrors: true, SilenceUsage: true, }
RootCommand is the root `kubesel` command.
View Source
var UserCommandOptions struct {
}
Functions ¶
func DetectTerminal ¶
func DetectTerminal()
DetectTerminalColors changes the default values for some options depending on whether kubsel is writing its output to a terminal.
func UseColumnOutput ¶
func UseColumnOutput(opts string, target *OutputFormat) error
UseColumnOutput updates the OutputFormat to display items in columns.
func UseListOutput ¶
func UseListOutput(opts string, target *OutputFormat) error
UseListOutput updates the OutputFormat to display items in a list.
func UseTableOutput ¶
func UseTableOutput(opts string, target *OutputFormat) error
UseTableOutput updates the OutputFormat to display items in a table.
Types ¶
type OutputFormat ¶
type OutputFormat struct {
// contains filtered or unexported fields
}
OutputFormat is the flag used by `kubesel list`.
func (*OutputFormat) DefaultIfUnset ¶
func (f *OutputFormat) DefaultIfUnset()
Click to show internal directories.
Click to hide internal directories.