deps

package
v0.0.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2025 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package deps provides dependency checking and management for sources.

Index

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL