repomd

package
v0.0.0-...-250bf0c Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open(name string) (io.ReadCloser, error)

Open opens the named file for reading with suffix-specified decompression.

Types

type Checksum

type Checksum struct {
	XMLName xml.Name     `xml:"checksum"`
	Type    ChecksumType `xml:"type,attr"`
	Pkgid   string       `xml:"pkgid,attr"`
	Value   string       `xml:",innerxml"`
}

type ChecksumType

type ChecksumType int
const (
	SHA256 ChecksumType = iota
)

func (ChecksumType) MarshalText

func (ct ChecksumType) MarshalText() (text []byte, err error)

func (*ChecksumType) UnmarshalText

func (ct *ChecksumType) UnmarshalText(text []byte) error

type Comps

type Comps struct {
	XMLName xml.Name `xml:"comps"`
	Groups  []Group  `xml:"group"`
}

type EVR

type EVR struct {
	Epoch   *int   `xml:"epoch,attr,omitempty"`
	Version string `xml:"ver,attr,omitempty"`
	Release string `xml:"rel,attr,omitempty"`
}

type File

type File struct {
	XMLName xml.Name `xml:"file"`
	Type    string   `xml:"type,attr,omitempty"`
	Name    string   `xml:",innerxml"`
}

type Format

type Format struct {
	XMLName   xml.Name `xml:"format"`
	License   string   `xml:"http://linux.duke.edu/metadata/rpm license"`
	Vendor    string   `xml:"http://linux.duke.edu/metadata/rpm vendor,selfclose"`
	Group     string   `xml:"http://linux.duke.edu/metadata/rpm group"`
	BuildHost string   `xml:"http://linux.duke.edu/metadata/rpm buildhost"`
	SourceRPM string   `xml:"http://linux.duke.edu/metadata/rpm sourcerpm"`

	HeaderRange RPMHeaderRange `xml:"http://linux.duke.edu/metadata/rpm header-range,selfclose"`

	Provides  RPMProvides  `xml:"http://linux.duke.edu/metadata/rpm provides,omitempty"`
	Requires  RPMRequires  `xml:"http://linux.duke.edu/metadata/rpm requires,omitempty"`
	Conflicts RPMConflicts `xml:"http://linux.duke.edu/metadata/rpm conflicts,omitempty"`
	Obsoletes RPMObsoletes `xml:"http://linux.duke.edu/metadata/rpm obsoletes,omitempty"`

	Files []File `xml:"file"`
}

type Group

type Group struct {
	XMLName     xml.Name     `xml:"group"`
	Id          string       `xml:"id"`
	Name        string       `xml:"name"`
	Description string       `xml:"description"`
	Default     bool         `xml:"default"`
	UserVisible bool         `xml:"uservisible"`
	PackageList []PackageReq `xml:"packagelist>packagereq"`
}

type Location

type Location struct {
	XMLName xml.Name `xml:"location"`
	HRef    string   `xml:"href,attr"`
}

type Metadata

type Metadata struct {
	XMLName  xml.Name  `xml:"http://linux.duke.edu/metadata/common metadata"`
	XMLNSRPM string    `xml:"xmlns:rpm,attr"`
	Count    int       `xml:"packages,attr"`
	Packages []Package `xml:"package"`
}

func NewMetadata

func NewMetadata() *Metadata

func ReadMetadata

func ReadMetadata(r io.Reader) (*Metadata, error)

func (*Metadata) Add

func (md *Metadata) Add(p Package)

func (*Metadata) WriteTo

func (md *Metadata) WriteTo(w io.Writer) error

func (*Metadata) WriteToIndent

func (md *Metadata) WriteToIndent(
	w io.Writer,
	prefix string,
	indent string,
) error

type Package

type Package struct {
	XMLName     xml.Name `xml:"package"`
	Type        string   `xml:"type,attr"`
	Name        string   `xml:"name"`
	Arch        string   `xml:"arch"`
	Version     Version  `xml:"version,selfclose"`
	Checksum    Checksum `xml:"checksum"`
	Summary     RawBytes `xml:"summary"`
	Description RawBytes `xml:"description"`
	Packager    string   `xml:"packager"`
	URL         string   `xml:"url"`
	Time        Time     `xml:"time,selfclose"`
	Size        Size     `xml:"size,selfclose"`
	Location    Location `xml:"location,selfclose"`
	Format      Format   `xml:"format"`
}

func LoadPackage

func LoadPackage(h *rpm.Head) (Package, error)

type PackageReq

type PackageReq struct {
	XMLName xml.Name `xml:"packagereq"`
	Type    ReqType  `xml:"type,attr"`
	Name    string   `xml:",chardata"`
}

type RPMConflicts

type RPMConflicts struct {
	XMLName xml.Name   `xml:"http://linux.duke.edu/metadata/rpm conflicts"`
	Entries []RPMEntry `xml:"http://linux.duke.edu/metadata/rpm entry,omitempty,selfclose"`
}

type RPMEntry

type RPMEntry struct {
	XMLName xml.Name `xml:"http://linux.duke.edu/metadata/rpm entry"`
	Name    string   `xml:"name,attr"`
	Flags   string   `xml:"flags,attr,omitempty"`
	EVR
	Pre int `xml:"pre,attr,omitempty"`
}

type RPMHeaderRange

type RPMHeaderRange struct {
	XMLName xml.Name `xml:"http://linux.duke.edu/metadata/rpm header-range,selfclose"`
	Start   int      `xml:"start,attr"`
	End     int      `xml:"end,attr"`
}

type RPMObsoletes

type RPMObsoletes struct {
	XMLName xml.Name   `xml:"http://linux.duke.edu/metadata/rpm obsoletes"`
	Entries []RPMEntry `xml:"http://linux.duke.edu/metadata/rpm entry,omitempty,selfclose"`
}

type RPMProvides

type RPMProvides struct {
	XMLName xml.Name   `xml:"http://linux.duke.edu/metadata/rpm provides"`
	Entries []RPMEntry `xml:"http://linux.duke.edu/metadata/rpm entry,omitempty,selfclose"`
}

type RPMRequires

type RPMRequires struct {
	XMLName xml.Name   `xml:"http://linux.duke.edu/metadata/rpm requires"`
	Entries []RPMEntry `xml:"http://linux.duke.edu/metadata/rpm entry,omitempty,selfclose"`
}

type RawBytes

type RawBytes struct {
	Data string `xml:",innerxml"`
}

type ReqType

type ReqType int
const (
	Mandatory ReqType = iota
	Optional
)

func (ReqType) MarshalText

func (rt ReqType) MarshalText() (text []byte, err error)

func (*ReqType) UnmarshalText

func (rt *ReqType) UnmarshalText(text []byte) error

type Size

type Size struct {
	XMLName   xml.Name `xml:"size"`
	Package   int      `xml:"package,attr"`
	Installed int      `xml:"installed,attr"`
	Archive   int      `xml:"archive,attr"`
}

type Time

type Time struct {
	XMLName xml.Name `xml:"time"`
	File    int      `xml:"file,attr"`
	Build   int      `xml:"build,attr"`
}

type Version

type Version struct {
	XMLName xml.Name `xml:"version"`
	EVR
}

Directories

Path Synopsis
Package xml implements a simple XML 1.0 parser that understands XML name spaces.
Package xml implements a simple XML 1.0 parser that understands XML name spaces.

Jump to

Keyboard shortcuts

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