Documentation
¶
Index ¶
- Variables
- type FilterFunc
- type Package
- type Packages
- type RepoData
- func (rd *RepoData) ETag() string
- func (rd *RepoData) Index() Packages
- func (rd *RepoData) LoadRepo(path, repo string) error
- func (rd *RepoData) NameIndex() []string
- func (rd *RepoData) Package(name string) *Package
- func (rd *RepoData) ReadRepo(r io.Reader, repo string) error
- func (rd *RepoData) ReadRepoIndex(r io.Reader, repo string) error
- type Time
- type URL
Constants ¶
This section is empty.
Variables ¶
var ErrNoIndex = fmt.Errorf("index not found: %s", repoIndexFile)
ErrNoIndex is returned if the repository's index property list isn't found.
Functions ¶
This section is empty.
Types ¶
type FilterFunc ¶
FilterFunc is a function that returns true if a package matches the filter, and false otherwise. Filters must not modify the packages they filter.
type Package ¶
type Package struct { PackageVersion string `plist:"pkgver" json:"-"` Name string `plist:"-" json:"name,omitempty"` Version string `plist:"-" json:"version,omitempty"` Revision int `plist:"-" json:"revision,omitempty"` Repository string `plist:"-" json:"repository,omitempty"` Architecture string `plist:"architecture" json:"architecture,omitempty"` BuildDate Time `plist:"build-date" json:"build_date,omitempty"` BuildOptions string `plist:"build-options" json:"build_options,omitempty"` FilenameSHA256 string `plist:"filename-sha256" json:"filename_sha256,omitempty"` FilenameSize int64 `plist:"filename-size" json:"filename_size,omitempty"` Homepage *URL `plist:"homepage" json:"homepage,omitempty"` InstalledSize int64 `plist:"installed_size" json:"installed_size,omitempty"` License string `plist:"license" json:"license,omitempty"` Maintainer string `plist:"maintainer" json:"maintainer,omitempty"` ShortDesc string `plist:"short_desc" json:"short_desc,omitempty"` Preserve bool `plist:"preserve" json:"preserve,omitempty"` SourceRevisions string `plist:"source-revisions" json:"source_revisions,omitempty"` RunDepends []string `plist:"run_depends" json:"run_depends,omitempty"` ShlibRequires []string `plist:"shlib-requires" json:"shlib_requires,omitempty"` ShlibProvides []string `plist:"shlib-provides" json:"shlib_provides,omitempty"` Conflicts []string `plist:"conflicts" json:"conflicts,omitempty"` Reverts []string `plist:"reverts" json:"reverts,omitempty"` Replaces []string `plist:"replaces" json:"replaces,omitempty"` Alternatives map[string][]string `plist:"alternatives" json:"alternatives,omitempty"` ConfFiles []string `plist:"conf_files" json:"conf_files,omitempty"` Index int `plist:"-" json:"-"` ETag string `plist:"-" json:"-"` }
Package describes an XBPS package as stored in a repository's repodata.
type Packages ¶
type Packages []*Package
Packages holds a slice of packages.
func (Packages) Filter ¶
func (ps Packages) Filter(filter FilterFunc) Packages
Filter returns a new Packages slice containing only packages that match the filter. The filter must not modify packages.
type RepoData ¶
type RepoData struct {
// contains filtered or unexported fields
}
RepoData describes an XBPS repository.
func NewRepoData ¶
func NewRepoData() *RepoData
NewRepoData allocates a new, empty repodata. It must be populated using LoadRepo.
func (*RepoData) Index ¶
Index returns the complete set of packages held in the RepoData. Callers must not modify the returned slice or packages.
func (*RepoData) LoadRepo ¶
LoadRepo attempts to load repodata from the given path and assigns packages the given repo string as their repository (not a field formally defined by an XBPS repository). If repo is an empty string, it attempts to determine the repository from the path.
If an error is returned, the receiver is in an undefined state.
func (*RepoData) NameIndex ¶
NameIndex returns the name of all packages, without version and revision.
func (*RepoData) Package ¶
Package returns the package, if any, identified by name. If no such package exists, it returns nil.
type Time ¶
Time is repodata-marshaling-friendly time.Time.
func (Time) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*Time) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type URL ¶
URL is a repodata-marshaling-friendly url.URL.
func (*URL) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*URL) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.