Documentation
¶
Index ¶
- Constants
- Variables
- type Discovery
- func (d *Discovery) EPELMirrors(ctx context.Context, version int, arch string) ([]MirrorInfo, error)
- func (d *Discovery) EPELVersions() []EPELVersionInfo
- func (d *Discovery) OCPVersions(ctx context.Context) ([]OCPVersion, error)
- func (d *Discovery) RHCOSVersions(ctx context.Context) ([]RHCOSVersion, error)
- func (d *Discovery) SpeedTest(ctx context.Context, urls []string, topN int) []SpeedResult
- type EPELVersionInfo
- type MirrorInfo
- type OCPVersion
- type RHCOSVersion
- type SpeedResult
Constants ¶
const ( DefaultOCPBaseURL = "https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp" DefaultRHCOSBaseURL = "https://mirror.openshift.com/pub/openshift-v4/x86_64/dependencies/rhcos" )
Variables ¶
var EPELArchitectures = []string{"x86_64", "aarch64", "ppc64le", "s390x"}
EPELArchitectures lists the CPU architectures supported by EPEL repositories.
var EPELVersions = []int{7, 8, 9, 10}
EPELVersions lists the EPEL major versions to discover mirrors for.
Functions ¶
This section is empty.
Types ¶
type Discovery ¶
type Discovery struct {
// contains filtered or unexported fields
}
Discovery provides methods to discover mirrors and versions for EPEL, OCP, and RHCOS, with an in-memory cache to avoid redundant upstream requests.
func NewDiscovery ¶
NewDiscovery creates a new Discovery service with sensible defaults.
func (*Discovery) EPELMirrors ¶
func (d *Discovery) EPELMirrors(ctx context.Context, version int, arch string) ([]MirrorInfo, error)
EPELMirrors fetches and parses the metalink for the given EPEL version and architecture, returning discovered mirrors sorted by preference. Results are cached.
func (*Discovery) EPELVersions ¶
func (d *Discovery) EPELVersions() []EPELVersionInfo
EPELVersions returns the known EPEL versions with their supported architectures.
func (*Discovery) OCPVersions ¶
func (d *Discovery) OCPVersions(ctx context.Context) ([]OCPVersion, error)
OCPVersions fetches and parses the OCP directory listing, returning available versions. Results are cached.
func (*Discovery) RHCOSVersions ¶
func (d *Discovery) RHCOSVersions(ctx context.Context) ([]RHCOSVersion, error)
RHCOSVersions fetches the RHCOS directory listing, discovers minor versions, then fetches builds for each minor version. Results are cached. If fetching builds for a specific minor version fails, a warning is logged and that minor is included with an empty builds list.
type EPELVersionInfo ¶
type EPELVersionInfo struct {
Version int `json:"version"`
Architectures []string `json:"architectures"`
}
EPELVersionInfo describes an EPEL repository version and its supported architectures.
type MirrorInfo ¶
type MirrorInfo struct {
URL string `json:"url"`
Country string `json:"country"`
Protocol string `json:"protocol"`
Preference int `json:"preference"`
}
MirrorInfo represents a single mirror endpoint discovered from a metalink or mirror list.
type OCPVersion ¶
OCPVersion identifies an OpenShift Container Platform release.
type RHCOSVersion ¶
RHCOSVersion identifies a Red Hat CoreOS version and its available builds.