Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alternative ¶
type Alternative struct {
Name, Constraints string
}
type ControlURL ¶
ControlURL represents an URL pointing to a file in the debian control file format. Debian repositories use this format for Release files, as well as Packages and the proper control files, described here:
https://www.debian.org/doc/debian-policy/ch-controlfields.html#syntax-of-control-files
Control files can generally be parsed with the cybozu-go/aptutil/apt library in go.
func (ControlURL) Get ¶
Get will return all the paragraph that have the field matching the specified regular expression.
func (ControlURL) Parse ¶
func (cu ControlURL) Parse(handler func(Paragraph) error) error
Parse fetches the control file and invoke the handler for each "paragraph" in the file. A paragraph is just a section like:
Package: 7kaa-data Source: 7kaa Version: 2.15.4p1+dfsg-1 Installed-Size: 103621 [...]
func (ControlURL) Supported ¶
func (cu ControlURL) Supported() bool
Supported returns true if the URL specifies a format that can be opened by this library.
type ControlURLs ¶
type ControlURLs []ControlURL
func (ControlURLs) First ¶
func (cu ControlURLs) First() *ControlURL
type Dependency ¶
type Dependency struct {
Alternative []Alternative
}
func (Dependency) First ¶
func (d Dependency) First() Alternative
type Paragraph ¶
func (Paragraph) Dependencies ¶
func (p Paragraph) Dependencies() []Dependency
type Repository ¶
func NewRepository ¶
func NewRepository(mirror, distribution string) (*Repository, error)
func (*Repository) Section ¶
func (r *Repository) Section() (SectionMap, error)
func (*Repository) URLBase ¶
func (r *Repository) URLBase() *url.URL
func (*Repository) URLPackages ¶
func (r *Repository) URLPackages(component, arch string) ControlURLs
URLPackages returns a set of URLs where the "Packages" file can be found. The Packages file is a file listing all the .deb packages available for the distribution.
arch is an architecture, like "all", "amd64", ... component is a string like "main", "non-free", "contrib", ...
func (*Repository) URLRelease ¶
func (r *Repository) URLRelease() *ControlURL