Documentation ¶
Index ¶
- Constants
- func GetBaseURLs(repos []ExternalRepository) []string
- func IBUrlsFromDir(dirPath string) ([]string, error)
- func Introspect(ctx context.Context, repo *dao.Repository, dao *dao.DaoRegistry) (int64, error, bool)
- func IntrospectUrl(ctx context.Context, url string) (int64, error, error)
- func IsRedHat(url string) bool
- func LoadCA() ([]byte, error)
- func RepoToRepoUpdate(repo dao.Repository) dao.RepositoryUpdate
- func SaveToFile(repoUrls []string) error
- func UpdateIntrospectionStatusMetadata(repo dao.Repository, dao *dao.DaoRegistry, count int64, err error) error
- type ExternalRepository
- type ImageBuilderArch
- type ImageBuilderRepo
- type ImageBuilderRepoJson
- type RedHatRepo
- type RedHatRepoImporter
Constants ¶
const Filename = "./pkg/external_repos/external_repos.json"
const RedHatGpgKeyFile = "redhat.gpg"
const RedHatReposFile = "redhat_repos.json"
const (
RhCdnHost = "cdn.redhat.com"
)
Variables ¶
This section is empty.
Functions ¶
func GetBaseURLs ¶
func GetBaseURLs(repos []ExternalRepository) []string
func IBUrlsFromDir ¶
IBUrlsFromDir Import Repo Urls from image builder's git repo The dirPath should point to GITDIR/distributions/ which contains the repo directories. Each directory contains a json file with the same name as the directory itself: ./distributions/rhel-90/rhel-90.json
func Introspect ¶
func Introspect(ctx context.Context, repo *dao.Repository, dao *dao.DaoRegistry) (int64, error, bool)
Introspect introspects a dao.Repository with the given Rpm inserting any needed RPMs and adding and removing associations to the repository Returns the number of new RPMs inserted system-wide and any error encountered
func IntrospectUrl ¶
IntrospectUrl Fetch the metadata of a url and insert RPM data Returns the number of new RPMs inserted system-wide, any introspection errors, and any fatal errors
func LoadCA ¶
LoadCA Load the CA certificate from the embedded file at 'test_files/ca.pem' Return []byte with the content of the file and nil for error if the process finish with success, else it returns nil and the error is filled.
func RepoToRepoUpdate ¶
func RepoToRepoUpdate(repo dao.Repository) dao.RepositoryUpdate
func SaveToFile ¶
SaveToFile Saves a list of repo urls to the external file
func UpdateIntrospectionStatusMetadata ¶
func UpdateIntrospectionStatusMetadata(repo dao.Repository, dao *dao.DaoRegistry, count int64, err error) error
UpdateIntrospectionStatusMetadata updates introspection timestamps, error, and status on repo. Use after calling Introspect().
Types ¶
type ExternalRepository ¶
type ExternalRepository struct {
BaseUrl string `json:"base_url"`
}
func LoadFromFile ¶
func LoadFromFile() ([]ExternalRepository, error)
LoadFromFile Loads repo urls from the external file
type ImageBuilderArch ¶
type ImageBuilderArch struct { Repositories []ImageBuilderRepo `json:"repositories"` ImageTypes []string `json:"image_types"` }
type ImageBuilderRepo ¶
type ImageBuilderRepo struct {
BaseUrl string `json:"baseurl"`
}
type ImageBuilderRepoJson ¶
type ImageBuilderRepoJson struct { MainArch ImageBuilderArch `json:"x86_64"` PlatformId string `json:"module_platform_id"` }
type RedHatRepo ¶
type RedHatRepo struct { Url string `json:"url"` Name string `json:"name"` Arch string `json:"arch"` DistributionVersion string `json:"distribution_version"` Selector string `json:"selector"` GpgKey string `json:"gpg_key"` Label string `json:"content_label"` }
func (RedHatRepo) ToRepositoryRequest ¶
func (rhr RedHatRepo) ToRepositoryRequest() api.RepositoryRequest
type RedHatRepoImporter ¶
type RedHatRepoImporter struct {
// contains filtered or unexported fields
}
func NewRedHatRepos ¶
func NewRedHatRepos(daoReg *dao.DaoRegistry) RedHatRepoImporter
func (*RedHatRepoImporter) LoadAndSave ¶
func (rhr *RedHatRepoImporter) LoadAndSave() error