solve

package
v0.2.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InstalledPolicy

type InstalledPolicy struct{}

func (*InstalledPolicy) PruneProvides

func (i *InstalledPolicy) PruneProvides(packages ops.Headers) ops.Headers

func (*InstalledPolicy) SelectRequest

func (i *InstalledPolicy) SelectRequest(packages ops.Headers) *ops.Header

func (*InstalledPolicy) SelectSolution

func (i *InstalledPolicy) SelectSolution(solutions Solutions) *Solution

type Job

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

func NewJob

func NewJob(op op.Operation, requirement *ops.Requirement) *Job

func (*Job) Op

func (j *Job) Op() op.Operation

func (*Job) Requirement

func (j *Job) Requirement() *ops.Requirement

type Operation

type Operation struct {
	Operation solution.Operation
	Package   *ops.Header

	Node graph.Node
}

func NewOperation

func NewOperation(op solution.Operation, pkg *ops.Header) *Operation

type Policy

type Policy interface {
	PruneProvides(packages ops.Headers) ops.Headers
	SelectRequest(packages ops.Headers) *ops.Header
	SelectSolution(solutions Solutions) *Solution
}

func NewPolicy

func NewPolicy(method PolicyMethod) Policy

type PolicyMethod

type PolicyMethod string
const (
	Updated   PolicyMethod = "updated"
	Installed PolicyMethod = "installed"
)

type Request

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

func NewRequest

func NewRequest() *Request

func (*Request) Install

func (r *Request) Install(requirement *ops.Requirement)

func (*Request) Jobs

func (r *Request) Jobs() []*Job

func (*Request) Remove

func (r *Request) Remove(requirement *ops.Requirement)

func (*Request) Update

func (r *Request) Update(requirement *ops.Requirement)

func (*Request) Upgrade

func (r *Request) Upgrade()

type Solution

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

func NewSolution

func NewSolution() *Solution

func (*Solution) AddOperation

func (s *Solution) AddOperation(operation *Operation)

func (*Solution) Get

func (s *Solution) Get(name string) *ops.Header

func (*Solution) Graph

func (s *Solution) Graph() ([]*Operation, error)

func (*Solution) Names

func (s *Solution) Names() []string

func (*Solution) Noop

func (s *Solution) Noop() bool

func (*Solution) Operations

func (s *Solution) Operations() []*Operation

type Solutions

type Solutions []Solution

func (Solutions) Len

func (slice Solutions) Len() int

func (Solutions) Less

func (slice Solutions) Less(i, j int) bool

func (Solutions) Swap

func (slice Solutions) Swap(i, j int)

type Solver

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

func NewSolver

func NewSolver(pool *ops.Pool, policy Policy) *Solver

func (*Solver) Cnf

func (s *Solver) Cnf() string

func (*Solver) SatSolutions

func (s *Solver) SatSolutions() []*sat.Solution

func (*Solver) Solutions

func (s *Solver) Solutions() Solutions

func (*Solver) Solve

func (s *Solver) Solve(request *Request) (*Solution, error)

type UpdatedPolicy

type UpdatedPolicy struct{}

func (*UpdatedPolicy) PruneProvides

func (u *UpdatedPolicy) PruneProvides(packages ops.Headers) ops.Headers

func (*UpdatedPolicy) SelectRequest

func (u *UpdatedPolicy) SelectRequest(packages ops.Headers) *ops.Header

func (*UpdatedPolicy) SelectSolution

func (u *UpdatedPolicy) SelectSolution(solutions Solutions) *Solution

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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