pkg

package
v0.0.0-...-5998bd7 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultManager = ""

DefaultManager if not empty is the default package-manager to use when missing

View Source
var ErrNotInstalled = errors.New("no candidate installed")

ErrNotInstalled is raised when the candidate package manager is not installed on the host system (use command-line -dry-run to avoid execution errors and just check your buildfile syntax)

View Source
var ErrUnknownManager = errors.New("unknown package manager")

ErrUnknownManager is raised when the asked manager does not exist

Functions

This section is empty.

Types

type PackageManager

type PackageManager interface {
	// SetExecContext sets the execution context, default is os/exec
	SetExecutor(exec.Executor)
	// Name of executable (to check if installed and for debug)
	Name() string
	// Fetch updates the package cache/databse
	Fetch() error
	// Upgrade already installed packages and whatever can be upgraded with warranty (e.g. kernel)
	Upgrade() error
	// Install a given package
	Install(string) error
	// Remove a package given package
	Remove(string) error
}

PackageManager is the common interface for all package-manager drivers (e.g. `dpkg` for debian-based, `pacman` for arch)

func Load

func Load(_manager string, _exec exec.Executor) (PackageManager, error)

Load a specific package-manager by its name

Jump to

Keyboard shortcuts

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