installer

package
v0.0.0-...-5faf5c6 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoMatchingArtifact = errors.New("no artifact matches the current system")
	ErrUnsupportedArch    = errors.New("your system architecture is not yet supported")
)

Functions

func DownloadPlugin

func DownloadPlugin(ctx context.Context, dst string, plg structs.PluginDesc) (string, error)

func FindMatchingArtifact

func FindMatchingArtifact(plg structs.PluginDesc) (string, string, error)

Types

type Installer

type Installer interface {
	// InstallPlugin should install the plugin defined in desc at the
	// local system and return the path to the installed binary.
	InstallPlugin(ctx context.Context, desc structs.PluginDesc) (string, error)
}

Installer defines the interface that is capable of downloading and installing plugins.

type PluginInstaller

type PluginInstaller struct {
	// TargetDirectory is the directory where plugins should be installed.
	TargetDirectory string
}

PluginInstaller implements the Installer interface and is capable of downloading and installing binary plugins at the local host.

func (*PluginInstaller) InstallPlugin

func (installer *PluginInstaller) InstallPlugin(ctx context.Context, plg structs.PluginDesc) (string, error)

InstallPlugin installs the plugin in the target directory and returns the path of the installed plugin binary.

Jump to

Keyboard shortcuts

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