aur

package
v0.22.2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package aur lets you query the Arch Linux User Repository (AUR).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns true if the error is an instance of NotFoundError.

Types

type NotFoundError

type NotFoundError struct {
	Names []string
}

NotFoundError is returned when a package could not be found on AUR.

The error message returned is different dependent on the number of packages that could not be found.

func (NotFoundError) Error

func (e NotFoundError) Error() string

type Package

type Package struct {
	ID             uint64
	Name           string
	PackageBaseID  uint64
	PackageBase    string
	Version        string
	Description    string
	URL            string
	NumVotes       int
	Popularity     float64
	OutOfDate      int
	Maintainer     string
	FirstSubmitted uint64
	LastModified   uint64
	URLPath        string
	Groups         []string
	Depends        []string
	MakeDepends    []string
	OptDepends     []string
	Conflicts      []string
	Provides       []string
	Replaces       []string
	License        []string
	Keywords       []string
}

Package is the information that we can retrieve about a package that is hosted on the Arch Linux User Repository (AUR), version 4.

JSON Example:

{
	"ID": 213309,
	"Name": "repoctl",
	"PackageBaseID": 96153,
	"PackageBase": "repoctl",
	"Version": "0.13-2",
	"Description": "A supplement to repo-add and repo-remove which simplifies managing local repositories",
	"URL": "https:\/\/github.com\/cassava\/repoctl",
	"NumVotes": 1,
	"OutOfDate": 0,
	"Maintainer": "cassava",
	"FirstSubmitted": 1437296687,
	"LastModified": 1437298275,
	"License": "MIT",
	"URLPath": "\/cgit\/aur.git\/snapshot\/repoctl.tar.gz",
	"CategoryID": 1,
	"Popularity": 0
}

func Read

func Read(pkgname string) (*Package, error)

Read reads package information from the Arch Linux User Repository (AUR) online.

If a package cannot be found, (nil, *NotFoundError) is returned.

func (*Package) DownloadURL

func (p *Package) DownloadURL() string

DownloadURL returns the URL for downloading the PKGBUILD tarball.

func (*Package) Pkg

func (p *Package) Pkg() *pacman.Package

Pkg converts an aur.Package into a pacman.Package.

Note that only a few fields in the resulting Package are actually filled in, namely Origin, Name, Version, Description, URL, and License. This is all the information that we are able to retrieve.

func (*Package) PkgDepends

func (p *Package) PkgDepends() []string

PkgDepends returns the dependencies of the package.

func (*Package) PkgMakeDepends

func (p *Package) PkgMakeDepends() []string

PkgMakeDepends returns the make dependenciess of the package.

func (*Package) PkgName

func (p *Package) PkgName() string

PkgName returns the unique name of the package.

func (*Package) PkgVersion

func (p *Package) PkgVersion() string

PkgVersion returns the version string of the package.

type Packages

type Packages []*Package

Packages is a slice of Package with several methods facilitating sorting, iterating, and converting to pacman.Packages.

func ReadAll

func ReadAll(pkgnames []string) (Packages, error)

ReadAll reads multiple packages from the Arch Linux User Repository (AUR) at once.

If any packages cannot be found, (Packages, *NotFoundError) is returned. That is, all successfully read packages are returned.

func SearchByName

func SearchByName(query string) (Packages, error)

func (Packages) Iterate

func (pkgs Packages) Iterate(f func(pacman.AnyPackage))

Iterate calls f for each package in the list of packages.

func (Packages) Len

func (pkgs Packages) Len() int

func (Packages) Less

func (pkgs Packages) Less(i, j int) bool

func (Packages) Pkgs

func (pkgs Packages) Pkgs() pacman.Packages

Pkgs returns the entire slice as pacman.Packages.

func (Packages) Swap

func (pkgs Packages) Swap(i, j int)

Jump to

Keyboard shortcuts

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