Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CacheDirectory ¶ added in v0.22.0
func CacheDirectory() string
CacheDirectory returns the full path to the cache directory where all of the plugins are stored.
func Install ¶ added in v0.22.0
Install installs the plugin to the host machine from either a path on the file system, or a URL. A configuration file must be present and valid at the source in order for the installation to complete successfully.
If the installation is successful, the plugin will be saved to the plugin cache inside of a folder named the same name of the plugin as defined in the plugins configuration file.
Types ¶
type ExitCodeError ¶ added in v0.70.0
type ExitCodeError struct {
Code int
}
ExitCodeError is returned by Exec when a plugin exits with a non-zero status code. It carries the plugin's actual exit code so callers can propagate it to conftest's own process exit code rather than collapsing every failure to 1.
func AsExitCodeError ¶ added in v0.70.0
func AsExitCodeError(err error) (*ExitCodeError, bool)
AsExitCodeError unwraps err looking for an ExitCodeError. If one is found it is returned along with true, otherwise it returns nil and false.
func (*ExitCodeError) Error ¶ added in v0.70.0
func (e *ExitCodeError) Error() string
type Plugin ¶
type Plugin struct {
Name string `yaml:"name"`
Version string `yaml:"version"`
Usage string `yaml:"usage"`
Description string `yaml:"description"`
Command string `yaml:"command"`
}
Plugin represents a plugin.
func FindAll ¶ added in v0.22.0
FindAll finds all of the plugins available on the local file system.
func FromDirectory ¶ added in v0.22.0
FromDirectory returns a plugin from a specific directory.
The given directory must contain a plugin configuration file in order to return successfully.
func Load ¶ added in v0.22.0
Load loads a plugin given the name of the plugin. The name of the plugin is defined in the plugin configuration and is stored in a folder with the name of the plugin.