Documentation
¶
Overview ¶
Package apt implements APT mirror internals. Use pkg.AptMirrorService instead.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HttpRequestError ¶
HttpRequestError represents HTTP request failures.
func (*HttpRequestError) Error ¶
func (e *HttpRequestError) Error() string
func (*HttpRequestError) Unwrap ¶
func (e *HttpRequestError) Unwrap() error
type InvalidMirrorError ¶
InvalidMirrorError is returned when a mirror is unreachable or invalid.
func (*InvalidMirrorError) Error ¶
func (e *InvalidMirrorError) Error() string
func (*InvalidMirrorError) Unwrap ¶
func (e *InvalidMirrorError) Unwrap() error
type JsonParseError ¶
JsonParseError is returned when JSON parsing fails.
func (*JsonParseError) Error ¶
func (e *JsonParseError) Error() string
type Mirror ¶
type Mirror struct {
HttpClient *http.Client
CacheTTL time.Duration
CacheDir string
DisableDiskCache bool
Distro Distro
// contains filtered or unexported fields
}
Mirror holds HTTP and cache state for apt index lookups.
func (*Mirror) CacheDirectory ¶
CacheDirectory returns the directory used for on-disk apt cache files.
func (*Mirror) FetchMirrorFile ¶
func (*Mirror) LookupPackageVersion ¶
func (m *Mirror) LookupPackageVersion( repositoryURL, packageName string, search *PackageSearch, ) (*PackageLookupResult, error)
LookupPackageVersion finds the latest package version on an APT mirror. Pass a non-nil search to limit which indexes are scanned (faster on live mirrors).
type PackageLookupResult ¶
type PackageLookupResult struct {
PackageName string
Version string
Suite string
Component string
Arch string
IndexPath string
Filename string
}
PackageLookupResult is returned by Mirror.LookupPackageVersion.
type PackageNotFoundError ¶
PackageNotFoundError is returned when a package does not exist in a repository.
func (*PackageNotFoundError) Error ¶
func (e *PackageNotFoundError) Error() string
type PackageSearch ¶
type ResponseReadError ¶
ResponseReadError is returned when reading an HTTP response body fails.
func (*ResponseReadError) Error ¶
func (e *ResponseReadError) Error() string
type SpeedTestError ¶
SpeedTestError is returned when a mirror speed test fails.
func (*SpeedTestError) Error ¶
func (e *SpeedTestError) Error() string
type TimeoutError ¶
TimeoutError is returned when an HTTP request times out.
func (*TimeoutError) Error ¶
func (e *TimeoutError) Error() string
type ValidationError ¶
ValidationError represents invalid user input.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string