Documentation ¶
Overview ¶
Package plugins provides functions for interacting with asdf plugins
Index ¶
- func Add(config config.Config, pluginName, pluginURL, ref string) error
- func PluginExists(dataDir, pluginName string) (bool, error)
- func Remove(config config.Config, pluginName string, stdout, stderr io.Writer) error
- type NoCallbackError
- type NoCommandError
- type Plugin
- func (p Plugin) CallbackPath(name string) (string, error)
- func (p Plugin) Exists() error
- func (p Plugin) ExtensionCommandPath(name string) (string, error)
- func (p Plugin) GetExtensionCommands() ([]string, error)
- func (p Plugin) LegacyFilenames() (filenames []string, err error)
- func (p Plugin) ParseLegacyVersionFile(path string) (versions []string, err error)
- func (p Plugin) RunCallback(name string, arguments []string, environment map[string]string, ...) error
- func (p Plugin) Update(conf config.Config, ref string, out, errout io.Writer) (string, error)
- type PluginAlreadyExists
- type PluginMissing
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PluginExists ¶
PluginExists returns a boolean indicating whether or not a plugin with the provided name is currently installed
Types ¶
type NoCallbackError ¶
type NoCallbackError struct {
// contains filtered or unexported fields
}
NoCallbackError is an error returned by RunCallback when a callback with particular name does not exist
func (NoCallbackError) Error ¶
func (e NoCallbackError) Error() string
type NoCommandError ¶
type NoCommandError struct {
// contains filtered or unexported fields
}
NoCommandError is an error returned by ExtensionCommandPath when an extension command with the given name does not exist
func (NoCommandError) Error ¶
func (e NoCommandError) Error() string
type Plugin ¶
Plugin struct represents an asdf plugin to all asdf code. The name and dir fields are the most used fields. Ref and Dir only still git info, which is only information and shown to the user at times.
func List ¶
List takes config and flags for what to return and builds a list of plugins representing the currently installed plugins on the system.
func New ¶
New takes config and a plugin name and returns a Plugin struct. It is intended for functions that need to quickly initialize a plugin.
func (Plugin) CallbackPath ¶
CallbackPath returns the full file path to a callback script
func (Plugin) Exists ¶
Exists returns a boolean indicating whether or not the plugin exists on disk.
func (Plugin) ExtensionCommandPath ¶
ExtensionCommandPath returns the path to the plugin's extension command script matching the name if it exists.
func (Plugin) GetExtensionCommands ¶
GetExtensionCommands returns a slice of strings representing all available extension commands for the plugin.
func (Plugin) LegacyFilenames ¶
LegacyFilenames returns a slice of filenames if the plugin contains the list-legacy-filenames callback.
func (Plugin) ParseLegacyVersionFile ¶
ParseLegacyVersionFile takes a file and uses the parse-legacy-file callback script to parse it if the script is present. Otherwise just reads the file directly. In either case the returned string is split on spaces and a slice of versions is returned.
type PluginAlreadyExists ¶
type PluginAlreadyExists struct {
// contains filtered or unexported fields
}
PluginAlreadyExists is an error returned when the specified plugin already exists
func NewPluginAlreadyExists ¶
func NewPluginAlreadyExists(plugin string) PluginAlreadyExists
NewPluginAlreadyExists generates a new PluginAlreadyExists error instance for a particular plugin
func (PluginAlreadyExists) Error ¶
func (e PluginAlreadyExists) Error() string
type PluginMissing ¶
type PluginMissing struct {
// contains filtered or unexported fields
}
PluginMissing is the error returned when Plugin.Exists is call and the plugin doesn't exist on disk.
func (PluginMissing) Error ¶
func (e PluginMissing) Error() string