dependency

package
v1.76.2 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnyOfChecker added in v1.76.1

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

AnyOfChecker evaluates one or more AnyOf groups against the current dependency graph. Each group is satisfied independently — for the package to pass, every group must have ≥1 installed member that meets its constraint.

AnyOf groups are checker-only and add no edges to the topological graph, so fallback chains across packages (A any-of {B, C}; B any-of {A, D}) do not produce cycles.

func NewAnyOfChecker added in v1.76.1

func NewAnyOfChecker(getter Getter, groups []AnyOfGroup) *AnyOfChecker

NewAnyOfChecker constructs an AnyOfChecker that resolves member versions through the given Getter (shared with the regular dependency.Checker).

func (*AnyOfChecker) Check added in v1.76.1

func (c *AnyOfChecker) Check() checker.Result

Check returns Enabled when every group has ≥1 installed member that satisfies its constraint. The first failing group short-circuits the result; the Reason is AnyOfDependenciesUnmet and the Message names the group plus its members in sorted order so identical inputs produce identical messages across reconciles.

type AnyOfGroup added in v1.76.1

type AnyOfGroup struct {
	Name    string
	Members map[string]*semver.Constraints
}

AnyOfGroup is an alternative-dependency group: at least one member must be installed and satisfy its constraint for the group to pass. A nil constraint on a member means "any installed version of this alternative is acceptable".

type Checker

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

func NewChecker

func NewChecker(getter Getter, dependencies map[string]Dependency) *Checker

func (*Checker) Check

func (c *Checker) Check() checker.Result

type Dependency

type Dependency struct {
	Constraint *semver.Constraints
	// if node not present, just skip check
	Optional bool
}

type Getter

type Getter func(module string) *semver.Version

type NoneOfChecker added in v1.76.1

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

NoneOfChecker evaluates one or more NoneOf groups against the current dependency graph. Each group is violated independently — for the package to pass, every group must have zero installed members that match their constraints. NoneOf groups are checker-only and add no edges to the topological graph; "must not be installed" expresses an admission predicate, not an ordering relation.

func NewNoneOfChecker added in v1.76.1

func NewNoneOfChecker(getter Getter, groups []NoneOfGroup) *NoneOfChecker

NewNoneOfChecker constructs a NoneOfChecker that resolves member versions through the given Getter (shared with the regular dependency.Checker and the AnyOfChecker).

func (*NoneOfChecker) Check added in v1.76.1

func (c *NoneOfChecker) Check() checker.Result

Check returns Enabled when every group has zero violators. The first failing group short-circuits the result; the Reason is NoneOfDependenciesViolated and the Message names the group plus its actual offending members in sorted order so identical inputs produce identical messages across reconciles.

type NoneOfGroup added in v1.76.1

type NoneOfGroup struct {
	Name    string
	Members map[string]*semver.Constraints
}

NoneOfGroup is a group of forbidden dependencies: no member may be installed in a way that matches its constraint. A nil constraint on a member forbids the module at any installed version; a non-nil constraint narrows the forbidden range, so versions outside the constraint remain acceptable.

Jump to

Keyboard shortcuts

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