Documentation ¶
Overview ¶
Package plugin assists at building the plugin's main
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustRoot ¶ added in v0.3.10
MustRoot generates a root cobra.Command for the plugin's main, and panics if there is an error
Types ¶
type Config ¶
type Config struct { Name string // Name is the intended executable's name Short string // Short is the short description shown on help Version string // Version indicates the version of the generator // Run represents the main loop of the generator, returning the // exit code Run func(io.ReadCloser, io.WriteCloser) int // RunE is an alternative to Run that returns an error directly RunE func(io.ReadCloser, io.WriteCloser) error }
Config specifies how the plugin operates
func (*Config) SetDefaults ¶
func (cfg *Config) SetDefaults()
SetDefaults attempts to fill possible gaps in the config
type ExitError ¶
ExitError is an error that is expected to be handled directly via os.Exit(e.Code)
func WithExitCode ¶ added in v0.3.11
WithExitCode wraps a fatal error in ExitError so callers know how to os.Exit
Click to show internal directories.
Click to hide internal directories.