Documentation
¶
Overview ¶
Package cliconfig loads the configuration for CLI commands with an explicit policy, so every command treats a missing or invalid file the same way.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Pipeline is for commands that run tests: a silent fallback to defaults // would report success without testing anything. Pipeline = Policy{Required: true, Validate: true, CheckPaths: true} // Compat is for the --stable flow, whose configs follow the fixed // contract and need not satisfy the gtool validator. Compat = Policy{Required: true} // Start is for commands that start containers from an optional config. Start = Policy{Validate: true} // Inspect is for read-only and teardown commands, which must work even // with a config that would not validate. Inspect = Policy{} )
Functions ¶
Types ¶
type Policy ¶
type Policy struct {
// Required fails when no file is given or found in the default locations.
Required bool
// Validate runs the validator on a loaded file (never on built-in defaults).
Validate bool
// CheckPaths makes the validator require configured paths to exist.
CheckPaths bool
}
Policy states whether a command needs a config file and how strictly it is checked before anything starts.
Click to show internal directories.
Click to hide internal directories.