installation

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func CleanupStaleKrewInstallations(dir, currentVersion string) error

CleanupStaleKrewInstallations removes the versions that aren't the current version.

func GetInstalledPluginReceipts added in v0.4.0

func GetInstalledPluginReceipts(receiptsDir string) ([]index.Receipt, error)

GetInstalledPluginReceipts returns a list of receipts.

func GetMatchingPlatform

func GetMatchingPlatform(platforms []index.Platform) (index.Platform, bool, error)

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

func InstalledPluginsFromIndex(receiptsDir, indexName string) ([]index.Receipt, error)

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.

func Uninstall

func Uninstall(p environment.Paths, name string) error

Uninstall will uninstall a plugin.

func Upgrade

func Upgrade(p environment.Paths, plugin index.Plugin, indexName string) error

Upgrade will reinstall and delete the old plugin. The operation tries to not get the plugin dir in a bad state if it fails during the process.

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

Directories

Path Synopsis
Package semver is a wrapper for handling of semantic version (https://semver.org) values.
Package semver is a wrapper for handling of semantic version (https://semver.org) values.

Jump to

Keyboard shortcuts

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