Documentation ¶
Overview ¶
Copyright © 2022 Martin Simango <shukomango@gmail.com>
Copyright © 2022 Martin Simango <shukomango@gmail.com>
Copyright © 2022 Martin Simango <shukomango@gmail.com>
Copyright © 2022 Martin Simango <shukomango@gmail.com>
Copyright © 2022 Martin Simango <shukomango@gmail.com>
Copyright © 2022 Martin Simango <shukomango@gmail.com>
Copyright © 2022 Martin Simango <shukomango@gmail.com>
Copyright © 2022 Martin Simango <shukomango@gmail.com>
Copyright © 2022 Martin Simango <shukomango@gmail.com>
Copyright © 2022 Martin Simango <shukomango@gmail.com>
Copyright © 2022 Martin Simango <shukomango@gmail.com>
Copyright © 2022 NAME HERE <EMAIL ADDRESS>
Copyright © 2022 NAME HERE <EMAIL ADDRESS>
Copyright © 2022 NAME HERE <EMAIL ADDRESS>
Copyright © 2022 Martin Simango <shukomango@gmail.com>
Copyright © 2022 Martin Simango <shukomango@gmail.com>
Copyright © 2022 Martin Simango <shukomango@gmail.com>
Copyright © 2022 Martin Simango <shukomango@gmail.com>
Copyright © 2022 Martin Simango <shukomango@gmail.com>
Index ¶
- Variables
- func Execute()
- type Plugin
- type PluginConfig
- type PluginConfigImpl
- func (pc *PluginConfigImpl) AddPlugin(plugin Plugin) error
- func (pc *PluginConfigImpl) DisplayConfig() error
- func (pc *PluginConfigImpl) DoesPluginExist(plugin string) bool
- func (pc *PluginConfigImpl) DoesPluginHaveCobraSupport(plugin string) bool
- func (pc *PluginConfigImpl) EditPlugin(pluginName string, completionFunctionName, description string, ...) error
- func (pc *PluginConfigImpl) GenerateCompletionScript() (string, error)
- func (pc *PluginConfigImpl) GeneratePluginConfig() error
- func (pc *PluginConfigImpl) GetCompletionFunctionName(plugin string) string
- func (pc PluginConfigImpl) GetCompletionScriptSection(plugin string) string
- func (pc *PluginConfigImpl) GetConfig() *PluginConfigImpl
- func (pc *PluginConfigImpl) GetPlugin(pluginName string) (*Plugin, error)
- func (pc PluginConfigImpl) PrintAllPlugins()
- func (pc PluginConfigImpl) PrintCobraPlugins()
- func (pc *PluginConfigImpl) WriteCleanConfig() error
- type Shells
Constants ¶
This section is empty.
Variables ¶
var CompletionCmd = &cobra.Command{ Use: "completion", Short: "Generate completion script", Long: "To load completions", DisableFlagsInUseLine: true, ValidArgs: []string{"bash", "zsh", "fish", "powershell"}, Args: cobra.ExactValidArgs(1), Run: func(cmd *cobra.Command, args []string) { switch args[0] { case "bash": cmd.Root().GenBashCompletion(os.Stdout) case "zsh": cmd.Root().GenZshCompletion(os.Stdout) case "fish": cmd.Root().GenFishCompletion(os.Stdout, true) case "powershell": cmd.Root().GenPowerShellCompletionWithDesc(os.Stdout) } }, }
Functions ¶
Types ¶
type PluginConfig ¶
type PluginConfig interface { AddPlugin(plugin Plugin) error DisplayConfig() error DoesPluginExist(plugin string) bool DoesPluginHaveCobraSupport(plugin string) bool EditPlugin(pluginName string, completionFunctionName, description string, completionFunctionSet, descriptionSet bool) error GetPlugin(pluginName string) (*Plugin, error) PrintAllPlugins() PrintCobraPlugins() GeneratePluginConfig() error GetCompletionFunctionName(plugin string) string GetCompletionScriptSection(plugin string) string GetConfig() *PluginConfigImpl GenerateCompletionScript() (string, error) WriteCleanConfig() error // contains filtered or unexported methods }
type PluginConfigImpl ¶
type PluginConfigImpl struct { ConfigFile string `yaml:"configfile,omitempty"` Shell string `yaml:"shell"` ShellLocation string `yaml:"shellLocation"` Plugins []Plugin `yaml:"plugins"` KubectlOverridePlugins []string `yaml:"kubectlOverridePlugins"` }
func NewBashPluginConfigImpl ¶
func NewBashPluginConfigImpl() *PluginConfigImpl
func NewEmptyPluginImpl ¶
func NewEmptyPluginImpl(shell, shellLocation string) *PluginConfigImpl
func NewPluginConfigImpl ¶
func NewPluginConfigImpl(shell, shellLocation string) *PluginConfigImpl
func NewZshPluginConfigImpl ¶
func NewZshPluginConfigImpl() *PluginConfigImpl
func (*PluginConfigImpl) AddPlugin ¶
func (pc *PluginConfigImpl) AddPlugin(plugin Plugin) error
func (*PluginConfigImpl) DisplayConfig ¶
func (pc *PluginConfigImpl) DisplayConfig() error
func (*PluginConfigImpl) DoesPluginExist ¶
func (pc *PluginConfigImpl) DoesPluginExist(plugin string) bool
func (*PluginConfigImpl) DoesPluginHaveCobraSupport ¶ added in v0.1.2
func (pc *PluginConfigImpl) DoesPluginHaveCobraSupport(plugin string) bool
func (*PluginConfigImpl) EditPlugin ¶
func (pc *PluginConfigImpl) EditPlugin(pluginName string, completionFunctionName, description string, completionFunctionSet, descriptionSet bool) error
func (*PluginConfigImpl) GenerateCompletionScript ¶
func (pc *PluginConfigImpl) GenerateCompletionScript() (string, error)
func (*PluginConfigImpl) GeneratePluginConfig ¶
func (pc *PluginConfigImpl) GeneratePluginConfig() error
func (*PluginConfigImpl) GetCompletionFunctionName ¶
func (pc *PluginConfigImpl) GetCompletionFunctionName(plugin string) string
func (PluginConfigImpl) GetCompletionScriptSection ¶ added in v0.1.2
func (pc PluginConfigImpl) GetCompletionScriptSection(plugin string) string
func (*PluginConfigImpl) GetConfig ¶
func (pc *PluginConfigImpl) GetConfig() *PluginConfigImpl
func (*PluginConfigImpl) GetPlugin ¶
func (pc *PluginConfigImpl) GetPlugin(pluginName string) (*Plugin, error)
func (PluginConfigImpl) PrintAllPlugins ¶ added in v0.1.2
func (pc PluginConfigImpl) PrintAllPlugins()
func (PluginConfigImpl) PrintCobraPlugins ¶ added in v0.1.2
func (pc PluginConfigImpl) PrintCobraPlugins()
func (*PluginConfigImpl) WriteCleanConfig ¶
func (pc *PluginConfigImpl) WriteCleanConfig() error