167 lines
4.4 KiB
Go
167 lines
4.4 KiB
Go
package repokit
|
|
|
|
import "encoding/xml"
|
|
|
|
type RpmPrimaryXMLData struct {
|
|
XMLName xml.Name `xml:"metadata"`
|
|
Xmlns string `xml:"xmlns,attr"`
|
|
XmlnsRPM string `xml:"xmlns:rpm,attr"`
|
|
PackageNum int `xml:"packages,attr"`
|
|
PackageList []*RpmPrimaryPackage `xml:"package"`
|
|
}
|
|
|
|
type RpmPrimaryPackage struct {
|
|
ID int64 `xml:"-"`
|
|
Type string `xml:"type,attr"`
|
|
Name string `xml:"name"`
|
|
Arch string `xml:"arch"`
|
|
Version RpmVersion `xml:"version"`
|
|
Checksum RpmChecksum `xml:"checksum"`
|
|
Summary string `xml:"summary"`
|
|
Description string `xml:"description"`
|
|
Packager string `xml:"packager"`
|
|
URL string `xml:"url"`
|
|
Time RpmTime `xml:"time"`
|
|
Size RpmSize `xml:"size"`
|
|
Location RpmLocation `xml:"location"`
|
|
Format RpmFormat `xml:"format"`
|
|
}
|
|
|
|
type RpmVersion struct {
|
|
Epoch string `xml:"epoch,attr"`
|
|
Ver string `xml:"ver,attr"`
|
|
Rel string `xml:"rel,attr"`
|
|
}
|
|
|
|
type RpmChecksum struct {
|
|
Type string `xml:"type,attr"`
|
|
PkgID string `xml:"pkgid,attr,omitempty"`
|
|
Value string `xml:",chardata"`
|
|
}
|
|
|
|
type RpmTime struct {
|
|
File string `xml:"file,attr"`
|
|
Build string `xml:"build,attr"`
|
|
}
|
|
|
|
type RpmSize struct {
|
|
Package string `xml:"package,attr"`
|
|
Installed string `xml:"installed,attr"`
|
|
Archive string `xml:"archive,attr"`
|
|
}
|
|
|
|
type RpmLocation struct {
|
|
Href string `xml:"href,attr"`
|
|
XMLBase string `xml:"xml:base,attr,omitempty"`
|
|
}
|
|
|
|
type RpmFormat struct {
|
|
License string `xml:"rpm:license"`
|
|
Vendor string `xml:"rpm:vendor"`
|
|
Group string `xml:"rpm:group"`
|
|
BuildHost string `xml:"rpm:buildhost"`
|
|
SourceRPM string `xml:"rpm:sourcerpm"`
|
|
HeaderRange RpmHeaderRange `xml:"rpm:header-range"`
|
|
Provides *RpmDepEntryList `xml:"rpm:provides,omitempty"`
|
|
Conflicts *RpmDepEntryList `xml:"rpm:conflicts,omitempty"`
|
|
Obsoletes *RpmDepEntryList `xml:"rpm:obsoletes,omitempty"`
|
|
Requires *RpmDepEntryList `xml:"rpm:requires,omitempty"`
|
|
Suggests *RpmDepEntryList `xml:"rpm:suggests,omitempty"`
|
|
Enhances *RpmDepEntryList `xml:"rpm:enhances,omitempty"`
|
|
Recommends *RpmDepEntryList `xml:"rpm:recommends,omitempty"`
|
|
Supplements *RpmDepEntryList `xml:"rpm:supplements,omitempty"`
|
|
Files []*RpmFile `xml:"file,omitempty"`
|
|
}
|
|
|
|
type RpmHeaderRange struct {
|
|
Start string `xml:"start,attr"`
|
|
End string `xml:"end,attr"`
|
|
}
|
|
|
|
type RpmDepEntryList struct {
|
|
Entries []RpmDepEntry `xml:"rpm:entry"`
|
|
}
|
|
|
|
type RpmDepEntry struct {
|
|
Name string `xml:"name,attr"`
|
|
Flags string `xml:"flags,attr,omitempty"`
|
|
Epoch string `xml:"epoch,attr,omitempty"`
|
|
Ver string `xml:"ver,attr,omitempty"`
|
|
Rel string `xml:"rel,attr,omitempty"`
|
|
Pre string `xml:"pre,attr,omitempty"`
|
|
}
|
|
|
|
type RpmFile struct {
|
|
Type string `xml:"type,attr,omitempty"`
|
|
Hash string `xml:"hash,attr,omitempty"`
|
|
Value string `xml:",chardata"`
|
|
}
|
|
|
|
type RpmFilelistsXMLData struct {
|
|
XMLName xml.Name `xml:"filelists"`
|
|
Xmlns string `xml:"xmlns,attr"`
|
|
PackageNum int `xml:"packages,attr"`
|
|
PackageList []*RpmFilelistsPackage `xml:"package"`
|
|
}
|
|
|
|
type RpmFilelistsExtXMLData struct {
|
|
XMLName xml.Name `xml:"filelists-ext"`
|
|
Xmlns string `xml:"xmlns,attr"`
|
|
PackageNum int `xml:"packages,attr"`
|
|
PackageList []*RpmFilelistsPackage `xml:"package"`
|
|
}
|
|
|
|
type RpmFilelistsPackage struct {
|
|
ID int64 `xml:"-"`
|
|
PkgID string `xml:"pkgid,attr"`
|
|
Name string `xml:"name,attr"`
|
|
Arch string `xml:"arch"`
|
|
Version RpmVersion `xml:"version"`
|
|
Checksum *RpmFilelistsChecksum `xml:"checksum,omitempty"`
|
|
File []*RpmFile `xml:"file"`
|
|
}
|
|
|
|
type RpmFilelistsChecksum struct {
|
|
Type string `xml:"type,attr"`
|
|
}
|
|
|
|
type RpmOtherXMLData struct {
|
|
XMLName xml.Name `xml:"otherdata"`
|
|
Xmlns string `xml:"xmlns,attr"`
|
|
PackageNum int `xml:"packages,attr"`
|
|
PackageList []*RpmOtherPackage `xml:"package"`
|
|
}
|
|
|
|
type RpmOtherPackage struct {
|
|
ID int64 `xml:"-"`
|
|
PkgID string `xml:"pkgid,attr"`
|
|
Name string `xml:"name,attr"`
|
|
Arch string `xml:"arch"`
|
|
Version RpmVersion `xml:"version"`
|
|
Changelog []*RpmChangelog `xml:"changelog,omitempty"`
|
|
}
|
|
|
|
type RpmChangelog struct {
|
|
Author string `xml:"author,attr"`
|
|
Date string `xml:"date,attr"`
|
|
Content string `xml:",chardata"`
|
|
}
|
|
|
|
type RpmRepomd struct {
|
|
XMLName xml.Name `xml:"repomd"`
|
|
Xmlns string `xml:"xmlns,attr"`
|
|
XmlnsRpm string `xml:"xmlns:rpm,attr"`
|
|
Revision string `xml:"revision"`
|
|
Data []*RpmRepomdRecord `xml:"data"`
|
|
}
|
|
|
|
type RpmRepomdRecord struct {
|
|
Type string `xml:"type,attr"`
|
|
Checksum RpmChecksum `xml:"checksum"`
|
|
OpenChecksum RpmChecksum `xml:"open-checksum"`
|
|
Location RpmLocation `xml:"location"`
|
|
Timestamp int64 `xml:"timestamp"`
|
|
Size int64 `xml:"size"`
|
|
OpenSize int64 `xml:"open-size"`
|
|
}
|