Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetExecutedVersion ¶
func GetExecutedVersion(installPath string, executionPath string, pathResolver func(string) (string, error)) (string, bool, error)
GetExecutedVersion returns the currently executed version. If krew is not executed as an plugin it will return a nil error and an empty string.
Types ¶
type Paths ¶ added in v0.2.0
type Paths struct {
// contains filtered or unexported fields
}
Paths contains all important environment paths
func MustGetKrewPaths ¶ added in v0.2.0
func MustGetKrewPaths() Paths
MustGetKrewPaths returns the inferred paths for krew. By default, it assumes $HOME/.krew as the base path, but can be overriden via KREW_ROOT environment variable.
func (Paths) BinPath ¶ added in v0.2.0
BinPath returns the path where plugin executable symbolic links are found. This path should be added to $PATH in client machine.
e.g. {BinPath}/kubectl-foo
func (Paths) DownloadPath ¶ added in v0.2.0
DownloadPath returns a temporary directory for downloading plugins. It does not create a new directory on each call.
func (Paths) IndexPath ¶ added in v0.2.0
IndexPath returns the base directory where plugin index repository is cloned.
e.g. {IndexPath}/plugins/{plugin}.yaml
func (Paths) InstallPath ¶ added in v0.2.0
InstallPath returns the base directory for plugin installations.
e.g. {InstallPath}/{plugin-name}
func (Paths) PluginInstallPath ¶ added in v0.2.0
PluginInstallPath returns the path to install the plugin.
e.g. {PluginInstallPath}/{version}/{..files..}
func (Paths) PluginVersionInstallPath ¶ added in v0.2.0
PluginVersionInstallPath returns the path to the specified version of specified plugin.
e.g. {PluginVersionInstallPath} = {PluginInstallPath}/{version}