dependencies

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsCircularDependency

func IsCircularDependency(err error) bool

IsCircularDependency checks if an error is a circular dependency error

Types

type CircularDependencyError

type CircularDependencyError struct {
	Service string
	Chain   []string
}

CircularDependencyError represents a circular dependency error

func (*CircularDependencyError) Error

func (e *CircularDependencyError) Error() string

type DependencyNode

type DependencyNode struct {
	ServiceName string            // Service name
	Version     string            // Version to install
	Required    bool              // Is this dependency required
	Environment map[string]string // Environment variable overrides
	IsInstalled bool              // Whether already installed
	Depth       int               // Depth in dependency tree (0 = root)
}

DependencyNode represents a service to be installed

type ResolutionResult

type ResolutionResult struct {
	InstallOrder []DependencyNode           // Topologically sorted installation order
	Graph        map[string][]string        // Dependency graph for visualization
	AllNodes     map[string]*DependencyNode // All nodes in the graph
}

ResolutionResult contains the resolved installation order

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

Resolver handles dependency resolution and installation order calculation

func NewResolver

func NewResolver(catalogMgr *catalog.Manager, configMgr *config.Manager) *Resolver

NewResolver creates a new dependency resolver

func (*Resolver) GetDependencyTree

func (r *Resolver) GetDependencyTree(result *ResolutionResult, rootService string) string

GetDependencyTree returns a human-readable dependency tree

func (*Resolver) GetInstalledDependencies

func (r *Resolver) GetInstalledDependencies(result *ResolutionResult) []DependencyNode

GetInstalledDependencies returns dependencies that are already installed

func (*Resolver) GetMissingDependencies

func (r *Resolver) GetMissingDependencies(result *ResolutionResult) []DependencyNode

GetMissingDependencies returns dependencies that need to be installed

func (*Resolver) Resolve

func (r *Resolver) Resolve(serviceName, version string) (*ResolutionResult, error)

Resolve resolves dependencies for a service and returns installation order This performs a depth-first search to build the dependency graph and then topologically sorts it to determine the correct installation order

func (*Resolver) ValidateDependencies

func (r *Resolver) ValidateDependencies(serviceName, version string) error

ValidateDependencies checks if all dependencies can be resolved

Jump to

Keyboard shortcuts

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