Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command interface { Plugin // ParentName allows to identify subcommands and its parents. ParentName() string // Run the command with the passed context, root and args. Run(context.Context, string, []string) error }
Command interface for commands that the CLI provides. a command is one of the top cli elements (build, fix, generate ...)
type FlagParser ¶
FlagParser is a plugin that will use the params to parse flags that may affect the way it work.
type HelpTexter ¶
type HelpTexter interface { // Help returns a string describing what the command/subcommand does. HelpText() string }
HelpTexter interface allows plugins to provide text to the help command or subcommand.
type Plugin ¶
type Plugin interface {
Name() string
}
Plugin interface is the base for the different plugins that can be attached to the plugin system. It is based on the `Name() string` method that will be useful for identification of the plugin.
Other plugins (PluginReceivers) could specify other interfaces to identify plugins specific to what they do.
type PluginReceiver ¶
PluginReceiver is an interface for those plugins that need to receive the list of plugins.
type RootFinder ¶
type RootFinder interface { Plugin // FindRoot returns the path to consider as root. FindRoot() string }
RootFinder allows some commands not to depend on the go.mod to determine the root folder, this comes handy for commands like New and Version.
type Subcommander ¶
type Subcommander interface { Command PluginReceiver Subcommands() []Command }
Subcommander allows a plugin to say which are its subcommands.