environment

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

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.

func Realpath added in v0.2.0

func Realpath(path string) (string, error)

Realpath evaluates symbolic links. If the path is not a symbolic link, it returns the cleaned path. Symbolic links with relative paths return error.

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) BasePath added in v0.2.0

func (p Paths) BasePath() string

BasePath returns krew base directory.

func (Paths) BinPath added in v0.2.0

func (p Paths) BinPath() string

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

func (p Paths) DownloadPath() string

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

func (p Paths) IndexPath() string

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

func (p Paths) InstallPath() string

InstallPath returns the base directory for plugin installations.

e.g. {InstallPath}/{plugin-name}

func (Paths) PluginInstallPath added in v0.2.0

func (p Paths) PluginInstallPath(plugin string) string

PluginInstallPath returns the path to install the plugin.

e.g. {PluginInstallPath}/{version}/{..files..}

func (Paths) PluginVersionInstallPath added in v0.2.0

func (p Paths) PluginVersionInstallPath(plugin, version string) string

PluginVersionInstallPath returns the path to the specified version of specified plugin.

e.g. {PluginVersionInstallPath} = {PluginInstallPath}/{version}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL