Documentation
¶
Index ¶
- Variables
- func Register(m Manager)
- type APK
- func (*APK) Exists() bool
- func (*APK) Format() string
- func (a *APK) Install(opts *Opts, pkgs ...string) error
- func (a *APK) InstallLocal(opts *Opts, pkgs ...string) error
- func (a *APK) ListInstalled(opts *Opts) (map[string]string, error)
- func (*APK) Name() string
- func (a *APK) Remove(opts *Opts, pkgs ...string) error
- func (a *APK) SetRootCmd(s string)
- func (a *APK) Sync(opts *Opts) error
- func (a *APK) Upgrade(opts *Opts, pkgs ...string) error
- func (a *APK) UpgradeAll(opts *Opts) error
- type APT
- func (*APT) Exists() bool
- func (*APT) Format() string
- func (a *APT) Install(opts *Opts, pkgs ...string) error
- func (a *APT) InstallLocal(opts *Opts, pkgs ...string) error
- func (a *APT) ListInstalled(opts *Opts) (map[string]string, error)
- func (*APT) Name() string
- func (a *APT) Remove(opts *Opts, pkgs ...string) error
- func (a *APT) SetRootCmd(s string)
- func (a *APT) Sync(opts *Opts) error
- func (a *APT) Upgrade(opts *Opts, pkgs ...string) error
- func (a *APT) UpgradeAll(opts *Opts) error
- type DNF
- func (*DNF) Exists() bool
- func (*DNF) Format() string
- func (d *DNF) Install(opts *Opts, pkgs ...string) error
- func (d *DNF) InstallLocal(opts *Opts, pkgs ...string) error
- func (d *DNF) ListInstalled(opts *Opts) (map[string]string, error)
- func (*DNF) Name() string
- func (d *DNF) Remove(opts *Opts, pkgs ...string) error
- func (d *DNF) SetRootCmd(s string)
- func (d *DNF) Sync(opts *Opts) error
- func (d *DNF) Upgrade(opts *Opts, pkgs ...string) error
- func (d *DNF) UpgradeAll(opts *Opts) error
- type Manager
- type Opts
- type Pacman
- func (*Pacman) Exists() bool
- func (*Pacman) Format() string
- func (p *Pacman) Install(opts *Opts, pkgs ...string) error
- func (p *Pacman) InstallLocal(opts *Opts, pkgs ...string) error
- func (p *Pacman) ListInstalled(opts *Opts) (map[string]string, error)
- func (*Pacman) Name() string
- func (p *Pacman) Remove(opts *Opts, pkgs ...string) error
- func (p *Pacman) SetRootCmd(s string)
- func (p *Pacman) Sync(opts *Opts) error
- func (p *Pacman) Upgrade(opts *Opts, pkgs ...string) error
- func (p *Pacman) UpgradeAll(opts *Opts) error
- type YUM
- func (*YUM) Exists() bool
- func (*YUM) Format() string
- func (y *YUM) Install(opts *Opts, pkgs ...string) error
- func (y *YUM) InstallLocal(opts *Opts, pkgs ...string) error
- func (y *YUM) ListInstalled(opts *Opts) (map[string]string, error)
- func (*YUM) Name() string
- func (y *YUM) Remove(opts *Opts, pkgs ...string) error
- func (y *YUM) SetRootCmd(s string)
- func (y *YUM) Sync(opts *Opts) error
- func (y *YUM) Upgrade(opts *Opts, pkgs ...string) error
- func (y *YUM) UpgradeAll(opts *Opts) error
- type Zypper
- func (*Zypper) Exists() bool
- func (*Zypper) Format() string
- func (z *Zypper) Install(opts *Opts, pkgs ...string) error
- func (z *Zypper) InstallLocal(opts *Opts, pkgs ...string) error
- func (z *Zypper) ListInstalled(opts *Opts) (map[string]string, error)
- func (*Zypper) Name() string
- func (z *Zypper) Remove(opts *Opts, pkgs ...string) error
- func (z *Zypper) SetRootCmd(s string)
- func (z *Zypper) Sync(opts *Opts) error
- func (z *Zypper) Upgrade(opts *Opts, pkgs ...string) error
- func (z *Zypper) UpgradeAll(opts *Opts) error
Constants ¶
This section is empty.
Variables ¶
View Source
var Args []string
View Source
var DefaultOpts = &Opts{ AsRoot: true, NoConfirm: false, }
View Source
var DefaultRootCmd = "sudo"
DefaultRootCmd is the command used for privilege elevation by default
Functions ¶
Types ¶
type APK ¶
type APK struct {
// contains filtered or unexported fields
}
APK represents the APK package manager
func (*APK) SetRootCmd ¶
func (*APK) UpgradeAll ¶
type APT ¶
type APT struct {
// contains filtered or unexported fields
}
APT represents the APT package manager
func (*APT) SetRootCmd ¶
func (*APT) UpgradeAll ¶
type DNF ¶
type DNF struct {
// contains filtered or unexported fields
}
DNF represents the DNF package manager
func (*DNF) SetRootCmd ¶
func (*DNF) UpgradeAll ¶
type Manager ¶
type Manager interface { // Name returns the name of the manager. Name() string // Format returns the packaging format of the manager. // Examples: rpm, deb, apk Format() string // Returns true if the package manager exists on the system. Exists() bool // Sets the command used to elevate privileges. Defaults to DefaultRootCmd. SetRootCmd(string) // Sync fetches repositories without installing anything Sync(*Opts) error // Install installs packages Install(*Opts, ...string) error // Remove uninstalls packages Remove(*Opts, ...string) error // Upgrade upgrades packages Upgrade(*Opts, ...string) error // InstallLocal installs packages from local files rather than repos InstallLocal(*Opts, ...string) error // UpgradeAll upgrades all packages UpgradeAll(*Opts) error // ListInstalled returns all installed packages mapped to their versions ListInstalled(*Opts) (map[string]string, error) }
Manager represents a system package manager
type Pacman ¶
type Pacman struct {
// contains filtered or unexported fields
}
Pacman represents the Pacman package manager
func (*Pacman) ListInstalled ¶
func (*Pacman) SetRootCmd ¶
func (*Pacman) UpgradeAll ¶
type YUM ¶
type YUM struct {
// contains filtered or unexported fields
}
YUM represents the YUM package manager
func (*YUM) SetRootCmd ¶
func (*YUM) UpgradeAll ¶
type Zypper ¶
type Zypper struct {
// contains filtered or unexported fields
}
Zypper represents the Zypper package manager
func (*Zypper) ListInstalled ¶
func (*Zypper) SetRootCmd ¶
func (*Zypper) UpgradeAll ¶
Click to show internal directories.
Click to hide internal directories.