Documentation
¶
Overview ¶
Package apt implements the apt mirror backend: Debian and Ubuntu repositories.
The backend is built around repository metadata rather than TTL guesses. Each suite's small InRelease file lists the SHA256 and size of every Packages index, plus Codename, Suite, Components and Architectures. Indexes are stored in a content-addressed blob cache (keyed by SHA256), so healthy mirrors of the same distro share one download, and each index is parsed once into a compact lookup map.
Index ¶
- Constants
- type ConfigOption
- type Distro
- type PackageDetail
- type QueryOptions
- type Service
- func (s *Service) Package(ctx context.Context, mirror string, q core.PackageQuery) (core.PackageResult, error)
- func (s *Service) Resolve(ctx context.Context, mirror string, q core.PackageQuery) (core.DownloadResult, error)
- func (s *Service) Speed(ctx context.Context, mirror string, o core.SpeedOptions) (core.SpeedResult, error)
- func (s *Service) Status(ctx context.Context, mirror string) (core.StatusResult, error)
Constants ¶
const DefaultSpeedDuration = 10 * time.Second
DefaultSpeedDuration bounds a speed-test download.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigOption ¶
type ConfigOption func(*Service)
ConfigOption customizes a Service at construction.
type Distro ¶
type Distro string
Distro identifies a distribution family for status/speed defaults and index discovery hints.
type PackageDetail ¶
type PackageDetail struct {
Suite string `json:"suite"`
Component string `json:"component"`
Arch string `json:"arch"`
Filename string `json:"filename,omitempty"`
IndexPath string `json:"index_path,omitempty"`
}
PackageDetail is apt's PackageResult.Detail payload.
type QueryOptions ¶
type QueryOptions struct {
// Suite is a suite name ("noble", "bookworm-updates") or codename.
// Empty scans all discovered suites and reports the latest codename.
Suite string
Component string // "main", "universe", ... Empty = any (wave order).
Arch string // "amd64", "arm64", ... Empty = any arch listed.
}
QueryOptions narrows an apt package lookup.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service implements core.Prober for apt repositories.
func (*Service) Package ¶
func (s *Service) Package(ctx context.Context, mirror string, q core.PackageQuery) (core.PackageResult, error)
Package implements core.Prober.
func (*Service) Resolve ¶
func (s *Service) Resolve(ctx context.Context, mirror string, q core.PackageQuery) (core.DownloadResult, error)
Resolve implements core.Prober: return the direct .deb URL.