Documentation
¶
Overview ¶
Package deps - dependency checker for Doki system and Go dependencies.
Package deps ensures all required dependencies are included in go.mod. This file imports all dependencies that Doki v0.10 requires.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectPackageManager ¶
func DetectPackageManager() string
DetectPackageManager returns the name of the first supported package manager found on $PATH. Supported managers are: pkg (Termux), apt/apt-get (Debian), apk (Alpine), pacman (Arch), brew (macOS), dnf/yum (RHEL), zypper (SUSE). Returns the empty string when none are found.
func InstallDep ¶
InstallDep uses the detected package manager to install the named dependency. It is best-effort: the native package name is resolved via pkgNameMap when the binary name differs from the package name (e.g. nft -> nftables). The command inherits the current process stdio so the user sees progress and can respond to prompts.
Types ¶
type GoDepResult ¶
GoDepResult is a single direct Go module dependency.
func CheckGoDeps ¶
func CheckGoDeps() ([]GoDepResult, error)
CheckGoDeps reads the nearest go.mod (walking up from the current working directory) and returns the direct (non-indirect) module requirements.
type SystemDep ¶
type SystemDep struct {
Name string
Required bool
Optional bool
Check func() (installed bool, version string)
InstallHint string
}
SystemDep describes a system-level dependency that Doki can use.
type SystemDepResult ¶
type SystemDepResult struct {
Name string
Installed bool
Version string
Required bool
Optional bool
InstallHint string
Path string
}
SystemDepResult is the outcome of checking a single SystemDep.
func CheckSystemDeps ¶
func CheckSystemDeps() []SystemDepResult
CheckSystemDeps inspects the host for tools that Doki can use and returns a result per dependency, in the canonical order.
type SystemDepsSummary ¶ added in v0.11.1
type SystemDepsSummary struct {
Total int
Installed int
MissingRequired []SystemDepResult
MissingOptional []SystemDepResult
}
SystemDepsSummary is an aggregate view suitable for doctor-style checks.
func SummarizeSystemDeps ¶ added in v0.11.1
func SummarizeSystemDeps(results []SystemDepResult) SystemDepsSummary
SummarizeSystemDeps aggregates dependency check results into counts and missing dependency groups.
func (SystemDepsSummary) Healthy ¶ added in v0.11.1
func (s SystemDepsSummary) Healthy() bool
Healthy reports whether all required dependencies are present.