database

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: AGPL-3.0 Imports: 5 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

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