zps

package
v0.0.0-...-32759e4 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: MPL-2.0 Imports: 11 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(solvables Solvables) Solvables

func (*InstalledPolicy) SelectRequest

func (i *InstalledPolicy) SelectRequest(solvables Solvables) Solvable

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 string, requirement *Requirement) *Job

func (*Job) Op

func (j *Job) Op() string

func (*Job) Requirement

func (j *Job) Requirement() *Requirement

type Operation

type Operation struct {
	Operation string
	Package   Solvable

	Node graph.Node
}

func NewOperation

func NewOperation(op string, pkg Solvable) *Operation

type OsArch

type OsArch struct {
	Os   string
	Arch string
}

func (*OsArch) String

func (oa *OsArch) String() string

type OsArches

type OsArches []*OsArch

func ExpandOsArch

func ExpandOsArch(osarch *OsArch) OsArches

func Platforms

func Platforms() OsArches

func (OsArches) Len

func (slice OsArches) Len() int

func (OsArches) Less

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

func (OsArches) Swap

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

type Pkg

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

func NewPkg

func NewPkg(name string, version string, publisher string, reqs []*Requirement, arch string, os string, summary string, description string) (*Pkg, error)

func NewPkgFromManifest

func NewPkgFromManifest(manifest *action.Manifest) (*Pkg, error)

func (*Pkg) Arch

func (p *Pkg) Arch() string

func (*Pkg) Channels

func (p *Pkg) Channels() []string

func (*Pkg) Columns

func (p *Pkg) Columns() string

func (*Pkg) Description

func (p *Pkg) Description() string

func (*Pkg) FileName

func (p *Pkg) FileName() string

func (*Pkg) Id

func (p *Pkg) Id() string

func (*Pkg) Location

func (p *Pkg) Location() int

func (*Pkg) Name

func (p *Pkg) Name() string

func (*Pkg) Os

func (p *Pkg) Os() string

func (*Pkg) Priority

func (p *Pkg) Priority() int

func (*Pkg) Publisher

func (p *Pkg) Publisher() string

func (*Pkg) Requirements

func (p *Pkg) Requirements() []*Requirement

func (*Pkg) Satisfies

func (p *Pkg) Satisfies(req *Requirement) bool

func (*Pkg) SetChannels

func (p *Pkg) SetChannels(channels ...string)

func (*Pkg) SetLocation

func (p *Pkg) SetLocation(location int)

func (*Pkg) SetPriority

func (p *Pkg) SetPriority(priority int)

func (*Pkg) Summary

func (p *Pkg) Summary() string

func (*Pkg) ToEntry

func (p *Pkg) ToEntry() *PkgEntry

func (*Pkg) Version

func (p *Pkg) Version() *Version

type PkgEntry

type PkgEntry struct {
	Id string `storm:"id"`

	Requirements []*Requirement

	Name      string
	Version   *Version
	Publisher string

	Arch        string
	Os          string
	Summary     string
	Description string

	Channels []string
}

func (*PkgEntry) ToPkg

func (p *PkgEntry) ToPkg() *Pkg

type Policy

type Policy interface {
	PruneProvides(solvables Solvables) Solvables
	SelectRequest(solvables Solvables) Solvable
	SelectSolution(solutions Solutions) *Solution
}

func NewPolicy

func NewPolicy(method string) Policy

type Pool

type Pool struct {
	Solvables Solvables
	// contains filtered or unexported fields
}

func NewPool

func NewPool(image *Repo, frozen map[string]bool, repos ...*Repo) (*Pool, error)

func (*Pool) Contains

func (p *Pool) Contains(pkg *Pkg) bool

func (*Pool) Frozen

func (p *Pool) Frozen(id string) bool

func (*Pool) Image

func (p *Pool) Image() Solvables

func (*Pool) Installed

func (p *Pool) Installed(req *Requirement) Solvable

func (*Pool) Location

func (p *Pool) Location(index int) *Repo

func (*Pool) RepoCount

func (p *Pool) RepoCount() int

func (*Pool) WhatDepends

func (p *Pool) WhatDepends(name string) Solvables

func (*Pool) WhatProvides

func (p *Pool) WhatProvides(req *Requirement) Solvables

type Repo

type Repo struct {
	Uri      string
	Priority int
	Enabled  bool
	Updated  time.Time
	// contains filtered or unexported fields
}

func NewRepo

func NewRepo(uri string, priority int, enabled bool, channels []string, solvables Solvables) *Repo

func (*Repo) Add

func (r *Repo) Add(pkgs ...*Pkg) Solvables

func (*Repo) Contains

func (r *Repo) Contains(pkg *Pkg) bool

func (*Repo) Index

func (r *Repo) Index()

func (*Repo) Load

func (r *Repo) Load(pkgs []*Pkg)

func (*Repo) Prune

func (r *Repo) Prune(count int) (Solvables, error)

func (*Repo) Remove

func (r *Repo) Remove(pkg *Pkg) error

func (*Repo) Solvables

func (r *Repo) Solvables() Solvables

type Repos

type Repos []*Repo

func (Repos) Len

func (slice Repos) Len() int

func (Repos) Less

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

func (Repos) Swap

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

type Request

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

func NewRequest

func NewRequest() *Request

func (*Request) Install

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

func (*Request) Jobs

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

func (*Request) Remove

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

func (*Request) Update

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

func (*Request) Upgrade

func (r *Request) Upgrade()

type Requirement

type Requirement struct {
	Name      string
	Method    string
	Operation int
	Version   *Version
}

func NewRequirement

func NewRequirement(name string, version *Version) *Requirement

func NewRequirementFromSimpleString

func NewRequirementFromSimpleString(id string) (*Requirement, error)

func (*Requirement) ANY

func (r *Requirement) ANY() *Requirement

func (*Requirement) Conflicts

func (r *Requirement) Conflicts() *Requirement

func (*Requirement) Depends

func (r *Requirement) Depends() *Requirement

func (*Requirement) EQ

func (r *Requirement) EQ() *Requirement

func (*Requirement) EXQ

func (r *Requirement) EXQ() *Requirement

func (*Requirement) GTE

func (r *Requirement) GTE() *Requirement

func (*Requirement) LTE

func (r *Requirement) LTE() *Requirement

func (*Requirement) Op

func (r *Requirement) Op(op string) *Requirement

func (*Requirement) OpInt

func (r *Requirement) OpInt(op string) int

func (*Requirement) OpString

func (r *Requirement) OpString() string

func (*Requirement) Provides

func (r *Requirement) Provides() *Requirement

func (*Requirement) String

func (r *Requirement) String() string

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) Solvable

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 Solvable

type Solvable interface {
	Id() string
	Name() string
	Version() *Version
	Requirements() []*Requirement
	Arch() string
	Os() string

	FileName() string

	Location() int
	SetLocation(location int)

	Priority() int
	SetPriority(priority int)

	SetChannels(...string)
	Channels() []string

	Satisfies(*Requirement) bool
}

type Solvables

type Solvables []Solvable

func (Solvables) Len

func (slice Solvables) Len() int

func (Solvables) Less

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

func (Solvables) Swap

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

type Solver

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

func NewSolver

func NewSolver(pool *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(solvables Solvables) Solvables

func (*UpdatedPolicy) SelectRequest

func (u *UpdatedPolicy) SelectRequest(solvables Solvables) Solvable

func (*UpdatedPolicy) SelectSolution

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

type Version

type Version struct {
	Semver    semver.Version
	Timestamp time.Time
}

func (*Version) Compare

func (v *Version) Compare(ve *Version) int

func (*Version) EQ

func (v *Version) EQ(ve *Version) bool

func (*Version) EXQ

func (v *Version) EXQ(ve *Version) bool

func (*Version) GT

func (v *Version) GT(ve *Version) bool

func (*Version) GTE

func (v *Version) GTE(ve *Version) bool

func (*Version) LT

func (v *Version) LT(ve *Version) bool

func (*Version) LTE

func (v *Version) LTE(ve *Version) bool

func (*Version) NEQ

func (v *Version) NEQ(ve *Version) bool

func (*Version) Parse

func (v *Version) Parse(version string) error

func (*Version) Short

func (v *Version) Short() string

func (*Version) String

func (v *Version) String() string

Jump to

Keyboard shortcuts

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