epel

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checksum

type Checksum struct {
	Type  string `xml:"type,attr"`
	Pkgid string `xml:"pkgid,attr"`
	Value string `xml:",chardata"`
}

Checksum represents the checksum element

type EPELProvider

type EPELProvider struct {
	ValidationProgress provider.ValidationProgressFn
	// contains filtered or unexported fields
}

EPELProvider implements provider.Provider for EPEL repositories

func NewEPELProvider

func NewEPELProvider(dataDir string, logger *slog.Logger) *EPELProvider

NewEPELProvider creates a new EPEL provider

func (*EPELProvider) Configure

func (p *EPELProvider) Configure(rawCfg provider.ProviderConfig) error

Configure loads provider-specific settings from the raw config

func (*EPELProvider) Name

func (p *EPELProvider) Name() string

Name returns the provider identifier

func (*EPELProvider) Plan

Plan compares upstream manifest against local state and returns a plan

func (*EPELProvider) SetName

func (p *EPELProvider) SetName(name string)

SetName overrides the default provider name with the user-chosen config name.

func (*EPELProvider) SetValidationProgress

func (p *EPELProvider) SetValidationProgress(fn provider.ValidationProgressFn)

SetValidationProgress sets the per-file progress callback for validation.

func (*EPELProvider) Sync

Sync executes the plan — downloads, validates, retries (stub implementation)

func (*EPELProvider) Type

func (p *EPELProvider) Type() string

func (*EPELProvider) Validate

Validate checks integrity of all local content against expected checksums

type Location

type Location struct {
	Href string `xml:"href,attr"`
}

Location represents the location element

type Package

type Package struct {
	Type     string   `xml:"type,attr"`
	Name     string   `xml:"name"`
	Arch     string   `xml:"arch"`
	Version  Version  `xml:"version"`
	Checksum Checksum `xml:"checksum"`
	Size     SizeInfo `xml:"size"`
	Location Location `xml:"location"`
}

Package represents a single rpm package in primary.xml

type PackageInfo

type PackageInfo struct {
	Name     string
	Arch     string
	Version  string
	Release  string
	Checksum string
	Size     int64
	Location string
}

PackageInfo is a simplified representation of package metadata for syncing

type PrimaryXML

type PrimaryXML struct {
	XMLName  xml.Name  `xml:"metadata"`
	Packages int       `xml:"packages,attr"`
	Package  []Package `xml:"package"`
}

PrimaryXML represents the root metadata element of primary.xml

func ParsePrimary

func ParsePrimary(data []byte) (*PrimaryXML, error)

ParsePrimary parses primary.xml data and returns package information. Uses xml.NewDecoder for better handling of RPM metadata XML which may contain XML entities and namespace prefixes.

func (*PrimaryXML) ExtractPackages

func (p *PrimaryXML) ExtractPackages() []PackageInfo

ExtractPackages converts parsed Package structs to PackageInfo structs

type RepomdChecksum

type RepomdChecksum struct {
	Type  string `xml:"type,attr"`
	Value string `xml:",chardata"`
}

RepomdChecksum represents the checksum element

type RepomdData

type RepomdData struct {
	Type     string         `xml:"type,attr"`
	Location RepomdLocation `xml:"location"`
	Checksum RepomdChecksum `xml:"checksum"`
	Size     int64          `xml:"size"`
}

RepomdData represents a single data element in repomd.xml

type RepomdLocation

type RepomdLocation struct {
	Href string `xml:"href,attr"`
}

RepomdLocation represents the location element

type RepomdXML

type RepomdXML struct {
	XMLName xml.Name     `xml:"repomd"`
	Data    []RepomdData `xml:"data"`
}

RepomdXML represents the structure of repomd.xml

func ParseRepomd

func ParseRepomd(data []byte) (*RepomdXML, error)

ParseRepomd parses repomd.xml data

func (*RepomdXML) FindPrimaryChecksum

func (r *RepomdXML) FindPrimaryChecksum() (string, error)

FindPrimaryChecksum finds the checksum of primary.xml.gz in the repomd data

func (*RepomdXML) FindPrimaryLocation

func (r *RepomdXML) FindPrimaryLocation() (string, error)

FindPrimaryLocation finds the location of primary.xml.gz in the repomd data

type SizeInfo

type SizeInfo struct {
	Package   int64 `xml:"package,attr"`
	Installed int64 `xml:"installed,attr"`
}

SizeInfo represents the size element with package and installed size

type Version

type Version struct {
	Epoch string `xml:"epoch,attr"`
	Ver   string `xml:"ver,attr"`
	Rel   string `xml:"rel,attr"`
}

Version represents the version element

Jump to

Keyboard shortcuts

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