19 lines
634 B
Go
19 lines
634 B
Go
package pkg
|
|
|
|
// DefaultManager if not empty is the default package-manager to use when missing
|
|
var DefaultManager = ""
|
|
|
|
// PackageManager is the common interface for all package-manager drivers (e.g. `dpkg` for debian-based, `pacman` for arch)
|
|
type PackageManager interface {
|
|
// 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
|
|
}
|