installer

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: MIT Imports: 6 Imported by: 2

Documentation

Overview

Package installer provides contracts to define a new installer.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnknownInstaller indicates that the installer is not registered.
	ErrUnknownInstaller = errors.New("unknown installer")
	// ErrNoInstaller indicates that the plugin has no supported installer.
	ErrNoInstaller = errors.New("no supported installer")
)

Functions

func Register

func Register(name string, validity Validity, constructor Constructor)

Register registers a plugin installer.

Types

type CallbackInstaller

type CallbackInstaller func(ctx context.Context, dest, src string) (*plugin.Plugin, error)

CallbackInstaller is a callback installer.

func (CallbackInstaller) Install

func (f CallbackInstaller) Install(ctx context.Context, dest, src string) (*plugin.Plugin, error)

Install installs the plugin.

type Constructor

type Constructor func(fs afero.Fs) Installer

Constructor is to construct a new installer.

type Installer

type Installer interface {
	Install(ctx context.Context, dest, src string) (*plugin.Plugin, error)
}

Installer installs a plugin from its URL.

func Find

func Find(ctx context.Context, src string) (Installer, error)

Find finds an installer for the given plugin url.

func New

func New(ctx context.Context, name string) (Installer, error)

New creates a new installer.

type Validity

type Validity func(ctx context.Context, source string) bool

Validity checks whether a plugin is supported by the plugin or not.

Jump to

Keyboard shortcuts

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