Documentation
¶
Index ¶
Constants ¶
View Source
const ( X86_64Arch Arch = "x86_64" // Default architecture for which scrape for packages. DefaultArch = X86_64Arch // Default regex to base the distro version detection on. CentosMirrorsDistroVersionRegex = `^(0|[1-9]\d*)(\.(0|[1-9]\d*)?)?(\.(0|[1-9]\d*)?)?(-[a-zA-Z\d][-a-zA-Z.\d]*)?(\+[a-zA-Z\d][-a-zA-Z.\d]*)?\/$` CentosPackageFileExtension = "rpm" CentosType = "centos" )
Variables ¶
View Source
var ( // Default configuration for scrape Centos (RPM) packages. // // TODO: support for templating default PackagesURI. // As of now URI templating depends on distro's viper.AllSettings() // data. CentosDefaultConfig = Config{ Mirrors: []Mirror{ {URL: "https://mirrors.edge.kernel.org/centos/"}, {URL: "https://archive.kernel.org/centos-vault/"}, }, Repositories: []Repository{ {Name: "base", URI: URITemplate("/os/" + DefaultArch + "/Packages/")}, {Name: "updates", URI: URITemplate("/updates/" + DefaultArch + "/Packages/")}, {Name: "BaseOS", URI: URITemplate("/BaseOS/" + DefaultArch + "/os/Packages/")}, {Name: "AppStream", URI: URITemplate("/AppStream/" + DefaultArch + "/os/Packages/")}, {Name: "Devel", URI: URITemplate("/Devel/" + DefaultArch + "/os/Packages/")}, }, Archs: []Arch{DefaultArch}, Versions: nil, } )
View Source
var DistroByType = map[Type]Distro{}
Functions ¶
This section is empty.
Types ¶
type Centos ¶
type Centos struct {
// contains filtered or unexported fields
}
type Config ¶
type Config struct { // A list of Mirrors to scrape. Mirrors []Mirror // The mirrored repositories. Repositories []Repository // A list of architecture for to which scrape packages. Archs []Arch // A list of Distro versions. Versions []Version }
type Distro ¶
type Distro interface { // Configure expects distro.Config and arbitrary variables // for config fields that support templating. Configure(Config, map[string]interface{}) error // GetPackages should return a slice of Package based on // the provided Filter-type filter. GetPackages(Filter) ([]Package, error) }
type Mirror ¶
type Mirror struct { Name string // The base URL of the package mirror // (e.g. https://mirrors.kernel.org/<distribution>) URL string }
type Repository ¶
type Repository struct { Name string URI URITemplate }
type URITemplate ¶
type URITemplate string
Click to show internal directories.
Click to hide internal directories.