yummeta

package
v0.0.40 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RepomdXMLFile    = "repomd.xml"
	PrimaryXMLFile   = "primary.xml"
	FilelistsXMLFile = "filelists.xml"
	OtherXMLFile     = "other.xml"

	PrimaryHeaderFormat = "<metadata xmlns=\"http://linux.duke.edu/metadata/common\" rpm=\"http://linux.duke.edu/metadata/rpm\" packages=\"%d\">"
	PrimaryFooter       = "</metadata>"

	FilelistsHeaderFormat = "<filelists xmlns=\"http://linux.duke.edu/metadata/filelists\" packages=\"%d\">"
	FilelistsFooter       = "</filelists>"

	OtherHeaderFormat = "<otherdata xmlns=\"http://linux.duke.edu/metadata/other\" packages=\"%d\">"
	OtherFooter       = "</otherdata>"
)

Variables

This section is empty.

Functions

func DataFilePrefix

func DataFilePrefix(dt DataType) string

func WalkPrimaryPackages

func WalkPrimaryPackages(r io.Reader, walkFn func(PrimaryPackage, int) error) error

Types

type DataType

type DataType string
const (
	PrimaryDataType           DataType = "primary"
	PrimaryDatabaseDataType   DataType = "primary_db"
	FilelistsDataType         DataType = "filelists"
	FilelistsDatabaseDataType DataType = "filelists_db"
	OtherDataType             DataType = "other"
	OtherDatabaseDataType     DataType = "other_db"
)

type FilelistsRoot

type FilelistsRoot struct {
	XMLName      xml.Name `xml:"filelists,omitempty"`
	Xmlns        string   `xml:"xmlns,attr,omitempty"`
	PackageCount int      `xml:"packages,attr,omitempty"`
	Packages     []byte   `xml:",innerxml"`
}

func (*FilelistsRoot) Data

func (r *FilelistsRoot) Data() []byte

func (*FilelistsRoot) Href

func (r *FilelistsRoot) Href(string)

type OtherRoot

type OtherRoot struct {
	XMLName      xml.Name `xml:"otherdata,omitempty"`
	Xmlns        string   `xml:"xmlns,attr,omitempty"`
	PackageCount int      `xml:"packages,attr,omitempty"`
	Packages     []byte   `xml:",innerxml"`
}

func (*OtherRoot) Data

func (r *OtherRoot) Data() []byte

func (*OtherRoot) Href

func (r *OtherRoot) Href(string)

type PrimaryPackage

type PrimaryPackage struct {
	Href string
	ID   string
}

type PrimaryRoot

type PrimaryRoot struct {
	XMLName      xml.Name `xml:"metadata,omitempty"`
	Xmlns        string   `xml:"xmlns,attr,omitempty"`
	XmlnsRpm     string   `xml:"xmlns:rpm,attr,omitempty"`
	Rpm          string   `xml:"rpm,attr,omitempty"`
	PackageCount int      `xml:"packages,attr,omitempty"`
	Packages     []byte   `xml:",innerxml"`
}

func (*PrimaryRoot) Data

func (r *PrimaryRoot) Data() []byte

func (*PrimaryRoot) Href

func (r *PrimaryRoot) Href(href string)

type RepoMdData

type RepoMdData struct {
	Type            string              `xml:"type,attr,omitempty"`
	Checksum        *RepoMdDataChecksum `xml:"checksum,omitempty"`
	OpenChecksum    *RepoMdDataChecksum `xml:"open-checksum,omitempty"`
	Location        *RepoMdDataLocation `xml:"location,omitempty"`
	Timestamp       int64               `xml:"timestamp,omitempty"`
	Size            int                 `xml:"size,omitempty"`
	OpenSize        int                 `xml:"open-size,omitempty"`
	DatabaseVersion string              `xml:"database_version,omitempty"`
}

type RepoMdDataChecksum

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

type RepoMdDataLocation

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

type RepoMdDistro

type RepoMdDistro struct {
	CpeID string `xml:"cpeid,attr,omitempty"`
	Value string `xml:",chardata"`
}

type RepoMdDistroRoot

type RepoMdDistroRoot struct {
	Distro []*RepoMdDistro `xml:"distro,omitempty"`
}

type RepoMdRoot

type RepoMdRoot struct {
	XMLName  xml.Name `xml:"repomd,omitempty"`
	Xmlns    string   `xml:"xmlns,attr,omitempty"`
	XmlnsRpm string   `xml:"xmlns:rpm,attr,omitempty"`
	Rpm      string   `xml:"rpm,attr,omitempty"`

	Revision string            `xml:"revision,omitempty"`
	Tags     *RepoMdDistroRoot `xml:"tags,omitempty"`
	Data     []*RepoMdData     `xml:"data,omitempty"`
}

func ParseRepomd

func ParseRepomd(r io.Reader) (*RepoMdRoot, error)

type XMLRoot

type XMLRoot interface {
	Data() []byte
	Href(string)
}

Jump to

Keyboard shortcuts

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