Documentation
¶
Index ¶
- type BuildOptions
- type RPMExtractor
- type RPMExtractorImpl
- type RQRepoQuerier
- type RepoQuerier
- type RepoQuerierOption
- type SpecInfo
- type SpecQuerier
- type Version
- func (v *Version) Compare(other *Version) int
- func (v *Version) Epoch() int
- func (v *Version) Equal(other *Version) bool
- func (v *Version) GreaterThan(other *Version) bool
- func (v *Version) LessThan(other *Version) bool
- func (v *Version) MarshalJSON() ([]byte, error)
- func (v *Version) Release() string
- func (v *Version) String() string
- func (v *Version) Version() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildOptions ¶
type BuildOptions struct {
// 'with' flags.
With []string
// 'without' flags.
Without []string
// Custom macro defines.
Defines map[string]string
}
BuildOptions encapsulates standard options for build-related RPM commands that may run in a mock environment.
type RPMExtractor ¶
type RPMExtractor interface {
// Extract extracts the contents of an RPM to the specified destination directory
Extract(rpmStream io.Reader, destDir string) error
}
RPMExtractor interface defines methods for extracting RPM packages.
func NewRPMExtractorImpl ¶
func NewRPMExtractorImpl(fs opctx.FS) (RPMExtractor, error)
NewRPMExtractorImpl creates a new RPMExtractor instance with the provided file system.
type RPMExtractorImpl ¶
type RPMExtractorImpl struct {
// contains filtered or unexported fields
}
RPMExtractorImpl implements RPMExtractor.
type RQRepoQuerier ¶
type RQRepoQuerier struct {
// contains filtered or unexported fields
}
RQRepoQuerier implements RepoQuerier as a wrapper around the "repoquery" command.
func NewRQRepoQuerier ¶
func NewRQRepoQuerier(cmdFactory opctx.CmdFactory, options ...RepoQuerierOption) (*RQRepoQuerier, error)
NewRQRepoQuerier creates a new RQRepoQuerier instance. Multiple repository URLs can be provided, the order is irrelevant. All URLs must be valid according to url.ParseRequestURI.
func (*RQRepoQuerier) GetLatestVersion ¶
GetLatestVersion returns the latest version of a component in the repository.
func (*RQRepoQuerier) GetRPMLocation ¶
func (q *RQRepoQuerier) GetRPMLocation(ctx context.Context, packageName string, version *Version) (string, error)
GetRPMLocation returns the URL for the RPM of a component.
type RepoQuerier ¶
type RepoQuerier interface {
// GetLatestVersion returns the latest version of a component in the repository.
GetLatestVersion(ctx context.Context, packageName string) (*Version, error)
// GetRPMLocation returns the URL for the RPM of a component.
GetRPMLocation(ctx context.Context, packageName string, version *Version) (string, error)
}
RepoQuerier interface defines methods for querying an RPM repository.
type RepoQuerierOption ¶
type RepoQuerierOption func(*repoQuerierConfig)
RepoQuerierOption represents an option that can be passed to NewRQRepoQuerier.
func WithBaseURLs ¶
func WithBaseURLs(baseURLs ...string) RepoQuerierOption
WithBaseURLs provides a RepoQuerier with the base URLs to query.
func WithReleaseVer ¶
func WithReleaseVer(releaseVer string) RepoQuerierOption
WithReleaseVer allows requesting a RepoQuerier to use a custom "releasever", e.g., to support URLs that contain `$releasever`.
NOTE: in case WithReleaseVer is passed multiple times, only the last one will take effect.
type SpecQuerier ¶
type SpecQuerier struct {
// contains filtered or unexported fields
}
SpecQuerier is a wrapper around querying RPM spec files using the `rpmspec` command. The latter is executed within an isolated environment, ensuring insulation from the host system.
func NewSpecQuerier ¶
func NewSpecQuerier(buildEnv buildenv.BuildEnv, buildOptions BuildOptions) *SpecQuerier
NewSpecQuerier constructs a new SpecQuerier instance that will use the provided buildenv.BuildEnv to run commands in an isolated environment. The provided BuildOptions will be used to influence the environment within which the spec is queried.
type Version ¶
type Version struct {
// contains filtered or unexported fields
}
Version is a wrapper around the RPM version implementation from github.com/knqyf263/go-rpm-version, preventing creation of invalid versions.
func NewVersion ¶
NewVersion creates a new Version from a string and returns an error if the version format is invalid.
func NewVersionFromEVR ¶
NewVersionFromEVR creates a new Version from epoch, version, and release strings.
func (*Version) Compare ¶
Compare compares this version with another version. Returns -1, 0, or 1 if this version is less than, equal to, or greater than the other version.
func (*Version) GreaterThan ¶
GreaterThan returns true if this version is greater than the other version.
func (*Version) MarshalJSON ¶
MarshalJSON serializes the version to JSON, thereby implementing json.Marshaler.