dependency

package
v1.78.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Satisfies

func Satisfies(constraint *semver.Constraints, version *semver.Version) bool

Satisfies reports whether version meets constraint as the rule compares them: prerelease and metadata are dropped first. A nil constraint accepts any version.

Types

type AnyOfGroup

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

AnyOfGroup passes when one member satisfies its constraint (nil: any version).

type AnyOfRule

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

AnyOfRule is a gate: every group must pass. The scheduler orders members only by soft edges, dropped where they close a cycle, so fallback chains (A any-of {B, C}; B any-of {A, D}) stay legal.

func NewAnyOfRule

func NewAnyOfRule(getter Getter, groups []AnyOfGroup) *AnyOfRule

NewAnyOfRule constructs an AnyOfRule.

func (*AnyOfRule) Decide

func (r *AnyOfRule) Decide() rule.Decision

Decide forbids on the first failing group, naming it and its members.

type Dependency

type Dependency struct {
	Constraint *semver.Constraints
	Optional   bool
}

Dependency is a requirement on another module's version; Optional skips an absent one.

type Getter

type Getter func(module string) *semver.Version

Getter returns the version of an enabled module, or nil.

type NoneOfGroup

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

NoneOfGroup passes when no member matches its forbidden constraint (nil: any version).

type NoneOfRule

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

NoneOfRule is a gate: every group must pass. It adds no ordering edge: "must not be installed" is a predicate, not an order.

func NewNoneOfRule

func NewNoneOfRule(getter Getter, groups []NoneOfGroup) *NoneOfRule

NewNoneOfRule constructs a NoneOfRule.

func (*NoneOfRule) Decide

func (r *NoneOfRule) Decide() rule.Decision

Decide forbids on the first violated group, naming it and its violators.

type Rule

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

Rule is a gate that forbids a package whose dependencies are absent or of an incompatible version.

func NewRule

func NewRule(getter Getter, dependencies map[string]Dependency) *Rule

NewRule constructs a dependency rule.

func (*Rule) Decide

func (r *Rule) Decide() rule.Decision

Decide forbids on the first dependency, by name, that is missing (and not optional) or violates its constraint.

Jump to

Keyboard shortcuts

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