kapt

package
v0.0.0-...-66343a0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: BSD-3-Clause Imports: 12 Imported by: 0

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

type ControlURL struct {
	url.URL
}

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) Decoder

func (cu ControlURL) Decoder(current io.Reader) (string, io.Reader, error)

Decoder returns an io.Reader capable of decoding the file.

func (ControlURL) Get

func (cu ControlURL) Get(field string, re *regexp.Regexp) ([]Paragraph, error)

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

func (ControlURLs) Parse

func (cu ControlURLs) Parse(handler func(Paragraph) error) error

type Dependency

type Dependency struct {
	Alternative []Alternative
}

func (Dependency) First

func (d Dependency) First() Alternative

type Origin

type Origin struct {
	Watch *common.Watch

	Distribution string
	Component    string
	Arch         string

	Repo *Repository
}

type Paragraph

type Paragraph struct {
	apt.Paragraph
	Origin Origin
}

func (Paragraph) Dependencies

func (p Paragraph) Dependencies() []Dependency

func (Paragraph) Get

func (p Paragraph) Get(key string) ([]string, bool)

func (Paragraph) KVersion

func (p Paragraph) KVersion() *common.KVersion

func (Paragraph) Package

func (p Paragraph) Package() string

func (Paragraph) Single

func (p Paragraph) Single(key string) string

func (Paragraph) URLFile

func (p Paragraph) URLFile() *url.URL

type Repository

type Repository struct {
	Mirror       *url.URL
	Distribution string
}

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) URLDeb

func (r *Repository) URLDeb(deb string) *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

type Section

type Section struct {
	Size   uint64
	SHA256 string
	Path   string
}

type SectionMap

type SectionMap map[string]Section

Jump to

Keyboard shortcuts

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