installer

package
v0.0.0-...-af25eba Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrAlreadyUpToDate 表示 plugin 版本已經最新
	ErrAlreadyUpToDate = errors.New("already up-to-date")
)

Functions

This section is empty.

Types

type InstallOption

type InstallOption struct {
	DryRun bool // 模擬 install, 只會印出相關訊息, 但所有的 install 指令都不會執行
	Force  bool // 表示如果當前已經安裝過, 會強制移除重新安裝
	Soft   bool // soft means remove exist plugin only if version is different
}

InstallOption 封裝了跟安裝有關的控制

type Installer

type Installer interface {
	Install() (*plugin.Plugin, error)
}

Installer 抽象化了 plugin 的安裝實作

func NewInstaller

func NewInstaller(log *logrus.Logger, source string, tag string, asset int, home paths.Home, opt *InstallOption) (Installer, error)

NewInstaller 依照傳入的資訊取得 plugin 的安裝實作

Jump to

Keyboard shortcuts

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