Documentation
¶
Overview ¶
Package deps provides dependency checking and management for sources.
Index ¶
- func AutoInstall(ctx context.Context, dep sources.Dependency) error
- func Check(ctx context.Context, dep sources.Dependency) sources.DependencyStatus
- func CheckAll(ctx context.Context, src sources.Source) map[string]sources.DependencyStatus
- func ConfirmSkipSource(sourceName string, missingDeps []sources.Dependency) bool
- func GetMissingDeps(deps []sources.Dependency, statuses map[string]sources.DependencyStatus) []sources.Dependency
- func HasMissingDeps(statuses map[string]sources.DependencyStatus) bool
- func ShowInstallInstructions(dep sources.Dependency)
- func ShowMissingDepsSummary(deps []sources.Dependency, sourceName string)
- type PromptOptions
- type PromptResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AutoInstall ¶
func AutoInstall(ctx context.Context, dep sources.Dependency) error
AutoInstall attempts to automatically install a dependency using its AutoInstallCommand.
func Check ¶
func Check(ctx context.Context, dep sources.Dependency) sources.DependencyStatus
Check verifies if a dependency is available on the system. It tries all CheckCommands in order and returns the first one that succeeds.
func CheckAll ¶
CheckAll checks all dependencies for a source. Returns a map of dependency name to status.
func ConfirmSkipSource ¶
func ConfirmSkipSource(sourceName string, missingDeps []sources.Dependency) bool
ConfirmSkipSource asks the user if they want to skip a source with missing dependencies.
func GetMissingDeps ¶
func GetMissingDeps(deps []sources.Dependency, statuses map[string]sources.DependencyStatus) []sources.Dependency
GetMissingDeps returns a list of dependencies that are missing.
func HasMissingDeps ¶
func HasMissingDeps(statuses map[string]sources.DependencyStatus) bool
HasMissingDeps returns true if any dependencies are missing.
func ShowInstallInstructions ¶
func ShowInstallInstructions(dep sources.Dependency)
ShowInstallInstructions displays installation instructions for a dependency.
func ShowMissingDepsSummary ¶
func ShowMissingDepsSummary(deps []sources.Dependency, sourceName string)
ShowMissingDepsSummary shows a summary of all missing dependencies.
Types ¶
type PromptOptions ¶
type PromptOptions struct {
// AutoInstall automatically installs dependencies without prompting.
AutoInstall bool
// SkipPrompts skips all prompts and dependencies.
SkipPrompts bool
// RequireAll requires all sources to succeed (fail if any deps missing).
RequireAll bool
}
PromptOptions configures how prompts are displayed and handled.
type PromptResult ¶
type PromptResult int
PromptResult represents the user's response to a dependency prompt.
const ( // PromptInstall indicates user wants to install the dependency. PromptInstall PromptResult = iota // PromptSkip indicates user wants to skip this dependency. PromptSkip // PromptCancel indicates user wants to cancel the entire operation. PromptCancel )
func PromptForMissingDep ¶
func PromptForMissingDep(dep sources.Dependency, sourceName string) PromptResult
PromptForMissingDep asks the user what to do about a missing dependency. Returns PromptInstall, PromptSkip, or PromptCancel.