aur

package module
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: GPL-3.0 Imports: 4 Imported by: 15

README

GoDoc

aur

Fork of aur with the following differences:

  • Structured client
  • Custom http client support
  • Request editing

aur-cli

Install

go get github.com/Jguer/aur/aur-cli

Client for simple AUR queries.

Examples:

  • Search packages in the AUR by name only containing "python37"
aur-cli -verbose -by name search python37
  • Search packages in the AUR by name only containing "python37". Display results as JSON.
aur-cli -verbose -json -by name search python37
  • Find all packages in the AUR maintained by "jguer"
aur-cli -verbose -by maintainer search jguer
  • Retrieve information on the package "linux-git"
aur-cli info linux-git
  • Retrieve detailed information on the package "linux-git"
aur-cli -verbose info linux-git

go wrapper for the AUR JSON API

Wrapper around the json API v5 for AUR found at http://aur.archlinux.org/rpc

LICENSE

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrServiceUnavailable = errors.New("AUR is unavailable at this moment")

ErrServiceUnavailable represents a error when AUR is unavailable.

Functions

func GetErrorByStatusCode added in v1.2.0

func GetErrorByStatusCode(code int) error

Types

type By

type By int

By specifies what to search by in RPC searches.

const (
	Name By = iota + 1
	NameDesc
	Maintainer
	Submitter
	Depends
	MakeDepends
	OptDepends
	CheckDepends
	None
	Provides
	Conflicts
	Replaces
	Keywords
	Groups
	CoMaintainers
)

func (By) String

func (by By) String() string

type HTTPRequestDoer

type HTTPRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPRequestDoer performs HTTP requests. The standard http.Client implements this interface.

type PayloadError

type PayloadError struct {
	StatusCode int
	ErrorField string
}

func (*PayloadError) Error

func (r *PayloadError) Error() string

type Pkg

type Pkg struct {
	ID             int      `json:"ID"`
	Name           string   `json:"Name"`
	PackageBaseID  int      `json:"PackageBaseID"`
	PackageBase    string   `json:"PackageBase"`
	Version        string   `json:"Version"`
	Description    string   `json:"Description"`
	URL            string   `json:"URL"`
	NumVotes       int      `json:"NumVotes"`
	Popularity     float64  `json:"Popularity"`
	OutOfDate      int      `json:"OutOfDate"`
	Maintainer     string   `json:"Maintainer"`
	Submitter      string   `json:"Submitter"`
	FirstSubmitted int      `json:"FirstSubmitted"`
	LastModified   int      `json:"LastModified"`
	URLPath        string   `json:"URLPath"`
	Depends        []string `json:"Depends"`
	MakeDepends    []string `json:"MakeDepends"`
	CheckDepends   []string `json:"CheckDepends"`
	Conflicts      []string `json:"Conflicts"`
	Provides       []string `json:"Provides"`
	Replaces       []string `json:"Replaces"`
	OptDepends     []string `json:"OptDepends"`
	Groups         []string `json:"Groups"`
	License        []string `json:"License"`
	Keywords       []string `json:"Keywords"`
	CoMaintainers  []string `json:"CoMaintainers"`
}

Pkg holds package information.

func (*Pkg) String added in v1.1.0

func (p *Pkg) String() string

type Query added in v1.2.0

type Query struct {
	Needles  []string
	By       By
	Contains bool // if true, search for packages containing the needle, not exact matches
}

type QueryClient added in v1.2.0

type QueryClient interface {
	Get(ctx context.Context, query *Query) ([]Pkg, error)
}

HTTPRequestDoer performs HTTP requests. The standard http.Client implements this interface.

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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