reporegistry

package
v0.61.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 7 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadAllRepositories

func LoadAllRepositories(confPaths []string) (rpmmd.DistrosRepoConfigs, error)

LoadAllRepositories loads all repositories for given distros from the given list of paths. Behavior is the same as with the LoadRepositories() method.

func LoadRepositories

func LoadRepositories(confPaths []string, distro string) (map[string][]rpmmd.RepoConfig, error)

LoadRepositories loads distribution repositories from the given list of paths. If there are duplicate distro repositories definitions found in multiple paths, the first encounter is preferred. For this reason, the order of paths in the passed list should reflect the desired preference.

Types

type RepoRegistry

type RepoRegistry struct {
	// contains filtered or unexported fields
}

RepoRegistry represents a database of distro and architecture specific RPM repositories. Image types are considered only if the loaded repository definition contains any ImageTypeTags.

func New

func New(repoConfigPaths []string) (*RepoRegistry, error)

New returns a new RepoRegistry instance with the data loaded from the given repoConfigPaths

func NewFromDistrosRepoConfigs

func NewFromDistrosRepoConfigs(distrosRepoConfigs rpmmd.DistrosRepoConfigs) *RepoRegistry

func NewTestedDefault

func NewTestedDefault() (*RepoRegistry, error)

NewTestedDefault returns a new RepoRegistry instance with the data loaded from the default test repositories

func (*RepoRegistry) DistroHasRepos

func (r *RepoRegistry) DistroHasRepos(distro, arch string) ([]rpmmd.RepoConfig, error)

DistroHasRepos returns the repositories for the distro+arch, and a found flag

func (*RepoRegistry) ListDistros

func (r *RepoRegistry) ListDistros() []string

ListDistros returns a list of all distros which have a repository defined in the registry.

func (*RepoRegistry) ReposByArchName

func (r *RepoRegistry) ReposByArchName(distro, arch string, includeTagged bool) ([]rpmmd.RepoConfig, error)

reposByArchName returns a slice of rpmmd.RepoConfig instances, which should be used for building image types for the specific architecture and distribution. This includes by default all repositories without any image type tags specified. Depending on the `includeTagged` argument value, repositories with image type tags set will be added to the returned slice or not.

The method does not verify if the given architecture name is actually part of the specific distribution definition.

func (*RepoRegistry) ReposByImageTypeName

func (r *RepoRegistry) ReposByImageTypeName(distro, arch, imageType string) ([]rpmmd.RepoConfig, error)

ReposByImageTypeName returns a slice of rpmmd.RepoConfig instances, which should be used for building the specific image type name (of a given distribution and architecture). The method does not verify if the given image type name is actually part of the architecture definition of the provided name. Therefore in general, all common distro-arch-specific repositories are returned for any image type name, even for non-existing ones.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL