Documentation
¶
Overview ¶
Package plugincmdtree provides functionality for constructing and maintaining the plugin command trees
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPluginsCommandTreeCachePath ¶
func GetPluginsCommandTreeCachePath() string
Types ¶
type Cache ¶
type Cache interface {
// GetPluginTree returns the plugin command tree
// If the plugin command tree doesn't exist, it constructs and adds the command tree to the cache
// and then returns the plugin command tree, otherwise it returns an error
GetPluginTree(rootCmd *cobra.Command, plugin *cli.PluginInfo) (*CommandNode, error)
// DeletePluginTree deletes the plugin command tree from the cache
DeletePluginTree(plugin *cli.PluginInfo) error
// DeleteTree deletes the entire command tree from the cache
DeleteTree() error
}
Cache is the local cache for storing and accessing command trees of different plugins
type CommandNode ¶
type CommandNode struct {
Subcommands map[string]*CommandNode `yaml:"subcommands" json:"subcommands"`
Aliases map[string]struct{} `yaml:"aliases" json:"aliases"`
AliasProcessed bool `yaml:"-" json:"-"`
}
func NewCommandNode ¶
func NewCommandNode() *CommandNode
Click to show internal directories.
Click to hide internal directories.