create common package-manager interface

This commit is contained in:
xdrm-brackets 2018-11-06 17:56:44 +01:00
parent 8283b2ff04
commit 1c2cdaf641
1 changed files with 13 additions and 0 deletions

13
pkg/common.go Normal file
View File

@ -0,0 +1,13 @@
package pkg
// PackageManager is the common interface for all package-manager drivers (e.g. `dpkg` for debian-based, `pacman` for arch)
type PackageManager interface {
// Fetch updates the package cache/databse
Fetch() bool
// Upgrade already installed packages and whatever can be upgraded with warranty (e.g. kernel)
Upgrade() bool
// Install a given package
Install(string) bool
// Remove a package given package
Remove(string) bool
}