resolution

package
v0.0.0-...-0cd719c Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByChannelAndVersion

func ByChannelAndVersion(e1 *store.CachedBundle, e2 *store.CachedBundle) bool

func ByVersionIncreasing

func ByVersionIncreasing(e1 *store.CachedBundle, e2 *store.CachedBundle) bool

func OLMVariableSource

func OLMVariableSource(requiredPackages []*RequiredPackage, logger *logrus.Logger) (v2.VariableSource[*store.CachedBundle, OLMVariable, *OLMEntitySource], error)

func Sort

func Sort[E any](slice []E, fn Comparable[E])

Types

type BundleVariable

type BundleVariable struct {
	*store.CachedBundle
	// contains filtered or unexported fields
}

func (BundleVariable) Constraints

func (b BundleVariable) Constraints() []sat.Constraint

func (BundleVariable) Identifier

func (b BundleVariable) Identifier() sat.Identifier

func (BundleVariable) OrderedEntities

func (b BundleVariable) OrderedEntities() []store.CachedBundle

type Comparable

type Comparable[E any] func(e1 *E, e2 *E) bool

func ByChannelAndVersionPreferRepository

func ByChannelAndVersionPreferRepository(repositoryID string) Comparable[store.CachedBundle]

type DependenciesVariableSource

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

func NewBundleVariableSource

func NewBundleVariableSource(seedEntities ...store.CachedBundle) *DependenciesVariableSource

func (*DependenciesVariableSource) GetVariables

func (r *DependenciesVariableSource) GetVariables(ctx context.Context, source *OLMEntitySource) ([]OLMVariable, error)

type Installable

type Installable struct {
	store.CachedBundle
	Dependencies map[string]store.CachedBundle
}

type IterableOLMEntitySource

type IterableOLMEntitySource interface {
	v2.EntitySource[*store.CachedBundle]
	Iterate(ctx context.Context, fn func(entity *store.CachedBundle) error) error
}

func NewIterableEntitySource

func NewIterableEntitySource(id v2.EntitySourceID, entities OLMEntitySet) IterableOLMEntitySource

type OLMEntitySet

type OLMEntitySet map[v2.EntityID]store.CachedBundle

type OLMEntitySource

type OLMEntitySource struct {
	store.PackageDatabase
}

func (OLMEntitySource) Get

func (OLMEntitySource) ID

type OLMSolver

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

func NewOLMSolver

func NewOLMSolver(packageDB store.PackageDatabase, logger *logrus.Logger) *OLMSolver

func (*OLMSolver) Solve

func (s *OLMSolver) Solve(ctx context.Context, requiredPackages ...*RequiredPackage) ([]Installable, error)

type OLMVariable

type OLMVariable interface {
	sat.Variable
	OrderedEntities() []store.CachedBundle
}

func NewBundleVariable

func NewBundleVariable(entity *store.CachedBundle, orderedDependencies ...store.CachedBundle) OLMVariable

func NewRequiredPackageVariable

func NewRequiredPackageVariable(id sat.Identifier, orderedEntities ...store.CachedBundle) OLMVariable

func NewUniquenessVariable

func NewUniquenessVariable(id sat.Identifier, orderedEntities ...store.CachedBundle) OLMVariable

type Option

type Option func(requiredPackage *RequiredPackage) error

func InChan

func InChan(channelName string) Option

func InRepo

func InRepo(repositoryName string) Option

func InVersionRange

func InVersionRange(versionRange string) Option

type Predicate

type Predicate[E any] interface {
	Keep(*E) bool
}

func And

func And[E any](predicates ...Predicate[E]) Predicate[E]

func DependencyOf

func DependencyOf(entity *store.CachedBundle) Predicate[store.CachedBundle]

func InChannel

func InChannel(channelName string) Predicate[store.CachedBundle]

func InPackage

func InPackage(packageName string) Predicate[store.CachedBundle]

func InRepository

func InRepository(repositoryName string) Predicate[store.CachedBundle]

func InSemverRange

func InSemverRange(versionRange semver.Range) Predicate[store.CachedBundle]

type RequiredPackage

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

func NewRequiredPackage

func NewRequiredPackage(packageName string, options ...Option) (*RequiredPackage, error)

func (*RequiredPackage) GetVariables

func (r *RequiredPackage) GetVariables(ctx context.Context, source *OLMEntitySource) ([]OLMVariable, error)

Jump to

Keyboard shortcuts

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