Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetExitCode ¶
GetExitCode returns the exit code of an error
Types ¶
type ExecCaller ¶
type ExecCaller struct{}
ExecCaller is a dummy struct to handle wrapping exec.Command in the SysCaller interface.
type Package ¶
type Package struct { // name of the package Name string `export:"name"` // package state; one of "present" or "absent" State State `export:"state"` PkgMgr PackageManager }
Package is an API for package state
func (*Package) PackageState ¶
PackageState returns a State ("present","absent") based on whether a package is installed or not.
type PackageManager ¶
type PackageManager interface { // If the package is installed, returns the version and true, otherwise // returns an empty string and false. InstalledVersion(string) (PackageVersion, bool) // Installs a package, returning an error if something went wrong InstallPackage(string) (string, error) // Removes a package, returning an error if something went wrong RemovePackage(string) (string, error) }
PackageManager describes an interface for managing packages and helps make `Check` and `Apply` testable.
type PackageVersion ¶
type PackageVersion string
PackageVersion is a type alias for a string, since various packages may use different naming conventions
Click to show internal directories.
Click to hide internal directories.