Documentation
¶
Overview ¶
Package packages provides package backend operations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AutoBackend = func() (string, error) { f, err := detect.Detect() if err != nil { return "", err } return f.Backend, nil }
AutoBackend resolves the backend string from the runtime environment. It is a variable so tests can substitute it.
Functions ¶
This section is empty.
Types ¶
type Apt ¶
type Apt struct {
Runner Runner
}
Apt is the Debian/Ubuntu backend skeleton.
func (*Apt) IsInstalled ¶
IsInstalled checks if a package is installed via dpkg.
type Backend ¶
type Backend interface {
// Present installs the given packages if not already present.
Present(ctx context.Context, pkgs []string) error
// Absent removes the given packages.
Absent(ctx context.Context, pkgs []string) error
// IsInstalled reports whether a package is already installed.
IsInstalled(ctx context.Context, pkg string) (bool, error)
}
Backend performs package operations.
type Dnf ¶
type Dnf struct {
Runner Runner
}
Dnf is the Fedora/RHEL backend skeleton.
func (*Dnf) IsInstalled ¶
IsInstalled checks if a package is installed via rpm.
type Paru ¶
type Paru struct {
Runner Runner
}
Paru is the Arch/CachyOS backend.
func (*Paru) IsInstalled ¶
IsInstalled checks if a package is installed via pacman.
Click to show internal directories.
Click to hide internal directories.