pacman

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: MIT Imports: 11 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

Overview

Package pacman implements the Arch Linux mirror backend.

Arch mirrors serve repo databases at <mirror>/<repo>/os/<arch>/<repo>.db — a gzip'd tar of per-package desc entries. The backend scans core and extra by default; QueryOptions.Repository selects another repo.

Index

Constants

View Source
const DefaultSpeedDuration = 10 * time.Second

DefaultSpeedDuration bounds a speed-test download.

Variables

This section is empty.

Functions

This section is empty.

Types

type Detail

type Detail struct {
	Repository string `json:"repository"`
	Arch       string `json:"arch"`
}

Detail is pacman's PackageResult.Detail payload.

type QueryOptions

type QueryOptions struct {
	Repository string // default "core"
	Arch       string // default: GOARCH mapping
}

QueryOptions customizes pacman Package lookups.

type ResolveOptions

type ResolveOptions struct {
	// Repository is the repo to resolve in (core, extra, multilib...).
	Repository string
	// Arch is the machine architecture (x86_64 by default).
	Arch string
}

ResolveOptions customizes pacman Resolve.

type Service

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

Service implements core.Prober for pacman mirrors.

func New

func New(cfg core.Config) *Service

New builds a pacman Service.

func (*Service) Package

func (s *Service) Package(ctx context.Context, mirror string, q core.PackageQuery) (core.PackageResult, error)

Package scans the repo database for a package's desc entry.

func (*Service) Resolve

func (s *Service) Resolve(ctx context.Context, mirror string, q core.PackageQuery) (core.DownloadResult, error)

Resolve returns the direct .pkg.tar.zst URL.

func (*Service) Speed

func (s *Service) Speed(ctx context.Context, mirror string, o core.SpeedOptions) (core.SpeedResult, error)

Speed measures throughput by downloading the extra repo database.

func (*Service) Status

func (s *Service) Status(ctx context.Context, mirror string) (core.StatusResult, error)

Status probes <repo>/os/<arch>/ directory listings.

Jump to

Keyboard shortcuts

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