Documentation ¶
Index ¶
- Variables
- func CleanupStaleKrewInstallations(dir, currentVersion string) error
- func GetInstalledPluginReceipts(receiptsDir string) ([]index.Receipt, error)
- func GetMatchingPlatform(platforms []index.Platform) (index.Platform, bool, error)
- func Install(p environment.Paths, plugin index.Plugin, indexName string, opts InstallOpts) error
- func InstalledPluginsFromIndex(receiptsDir, indexName string) ([]index.Receipt, error)
- func IsWindows() bool
- func Uninstall(p environment.Paths, name string) error
- func Upgrade(p environment.Paths, plugin index.Plugin, indexName string) error
- type InstallOpts
- type OSArchPair
Constants ¶
This section is empty.
Variables ¶
var ( ErrIsAlreadyInstalled = errors.New("can't install, the newest version is already installed") ErrIsNotInstalled = errors.New("plugin is not installed") ErrIsAlreadyUpgraded = errors.New("can't upgrade, the newest version is already installed") )
Plugin lifecycle errors
Functions ¶
func CleanupStaleKrewInstallations ¶
CleanupStaleKrewInstallations removes the versions that aren't the current version.
func GetInstalledPluginReceipts ¶ added in v0.4.0
GetInstalledPluginReceipts returns a list of receipts.
func GetMatchingPlatform ¶
GetMatchingPlatform finds the platform spec in the specified plugin that matches the os/arch of the current machine (can be overridden via KREW_OS and/or KREW_ARCH).
func Install ¶
func Install(p environment.Paths, plugin index.Plugin, indexName string, opts InstallOpts) error
Install will download and install a plugin. The operation tries to not get the plugin dir in a bad state if it fails during the process.
func InstalledPluginsFromIndex ¶ added in v0.4.0
InstalledPluginsFromIndex returns a list of all install plugins from a particular index.
func IsWindows ¶
func IsWindows() bool
IsWindows sees if KREW_OS or runtime.GOOS to find out if current execution mode is win32.
Types ¶
type InstallOpts ¶
type InstallOpts struct {
ArchiveFileOverride string
}
InstallOpts specifies options for plugin installation operation.
type OSArchPair ¶
type OSArchPair struct {
OS, Arch string
}
OSArchPair is wrapper around operating system and architecture
func OSArch ¶
func OSArch() OSArchPair
OSArch returns the OS/arch combination to be used on the current system. It can be overridden by setting KREW_OS and/or KREW_ARCH environment variables.
func (OSArchPair) String ¶
func (p OSArchPair) String() string
String converts environment into a string