database

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: MPL-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 PackageDB

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

PackageDB is a package database.

func NewPackageDB

func NewPackageDB() *PackageDB

NewPackageDB creates a new package database.

func (*PackageDB) Add

func (db *PackageDB) Add(pkg types.Package)

Add adds a package to the database.

func (*PackageDB) AddAll

func (db *PackageDB) AddAll(packageList []types.Package)

AddAll adds multiple packages to the database.

func (*PackageDB) EarlierOrEqual

func (db *PackageDB) EarlierOrEqual(name string, version version.Version) (packageList []types.Package)

EarlierOrEqual returns all packages that match the provided name and are earlier or equal to the provided version.

func (*PackageDB) ExactlyEqual

func (db *PackageDB) ExactlyEqual(name string, version version.Version) (*types.Package, bool)

ExactlyEqual returns the package that matches the provided name and version.

func (*PackageDB) ForEach

func (db *PackageDB) ForEach(fn func(pkg types.Package) error) error

ForEach iterates over each package in the database. If the provided function returns an error, the iteration will stop.

func (*PackageDB) Get

func (db *PackageDB) Get(name string) (packageList []types.Package)

Get returns all packages that match the provided name.

func (*PackageDB) LaterOrEqual

func (db *PackageDB) LaterOrEqual(name string, version version.Version) (packageList []types.Package)

LaterOrEqual returns all packages that match the provided name and are later or equal to the provided version.

func (*PackageDB) Len

func (db *PackageDB) Len() int

Len returns the total number of packages in the database.

func (*PackageDB) Remove

func (db *PackageDB) Remove(pkg types.Package)

Remove removes a package from the database.

func (*PackageDB) StrictlyEarlier

func (db *PackageDB) StrictlyEarlier(name string, version version.Version) (packageList []types.Package)

StrictlyEarlier returns all packages that match the provided name and are strictly earlier than the provided version.

func (*PackageDB) StrictlyLater

func (db *PackageDB) StrictlyLater(name string, version version.Version) (packageList []types.Package)

StrictlyLater returns all packages that match the provided name and are strictly later than the provided version.

Jump to

Keyboard shortcuts

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