Documentation
¶
Index ¶
- func UncompressPackages(downloads []FileByte) (io.Reader, error)
- func UncompressSources(downloads []FileByte) (io.Reader, error)
- type Client
- func (c *Client) InRelease(ctx context.Context, uri *url.URL, suite string) (InRelease, error)
- func (c *Client) Packages(ctx context.Context, uri *url.URL, suite string, component Component) (PackagesBytes, error)
- func (c *Client) Sources(ctx context.Context, uri *url.URL, suite string, component Component) (SourcesBytes, error)
- func (c *Client) StreamFile(ctx context.Context, uri *url.URL, suite string, file FileHash) (io.ReadCloser, error)
- func (c *Client) StreamPackage(ctx context.Context, uri *url.URL, file FileHash) (io.ReadCloser, error)
- func (c *Client) StreamSource(ctx context.Context, uri *url.URL, file FileHash) (io.ReadCloser, error)
- type Component
- type Components
- type ComponentsDiff
- type Config
- type Configs
- type FileByte
- type FileBytes
- type FileBytesDiff
- type FileHash
- type FileHashes
- type FileHashesDiff
- type InRelease
- type InReleaseSum
- type Package
- type Packages
- type PackagesBytes
- type PackagesDiff
- type Source
- type SourceSum
- type Sources
- type SourcesBytes
- type SourcesDiff
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
func (*Client) Sources ¶
func (c *Client) Sources( ctx context.Context, uri *url.URL, suite string, component Component, ) (SourcesBytes, error)
Sources downloads and parses Sources index files from a remote HTTP mirror.
func (*Client) StreamFile ¶
func (*Client) StreamPackage ¶
type Component ¶
type Component struct {
Name string
Architecture string
Files FileHashes
}
Component is a component/architecture pair in an InRelease file.
type Components ¶
type Components []Component
Components is a Component slice.
func (Components) Diff ¶
func (p Components) Diff(n Components) ComponentsDiff
type ComponentsDiff ¶
type ComponentsDiff struct {
Added Components
Removed Components
Changed Components
}
type Configs ¶
func MapConfigs ¶
MapConfigs turns config.Source into a Configs. Since a source can have multiple URIs and those can collide between different sources, we need to know which URI has which suites.
type FileBytes ¶
type FileBytes []FileByte
func (FileBytes) Diff ¶
func (p FileBytes) Diff(n FileBytes) FileBytesDiff
type FileBytesDiff ¶
type FileHash ¶
type FileHash struct {
MD5Sum string
SHA1 string
SHA256 string
SHA512 string
Size uint
// Filename may begin with `${component}/` from [InRelease], `pool/${suite}/`
// from [Packages] or `pool/${suite}/` from [Source].
Filename string
}
FileHash is a single file entry in an InRelease file. It's also used as a lowest common denominator for Packages file entries.
type FileHashes ¶
FileHashes contains all the file entries of an InRelease file.
func (FileHashes) Diff ¶
func (p FileHashes) Diff(n FileHashes) FileHashesDiff
type FileHashesDiff ¶
type FileHashesDiff struct {
Added FileHashes
Removed FileHashes
Changed FileHashes
}
type InRelease ¶
type InRelease struct {
Hash string
Architectures []string
Codename string
Components []string
Date string
Description string
Label string
Origin string
Suite string
Version string
AcquireByHash string
MD5Sum []InReleaseSum
SHA1 []InReleaseSum
SHA256 []InReleaseSum
SHA512 []InReleaseSum
Raw []byte
Warnings []error
}
InRelease is a parsed InRelease file from a Debian Repository.
See https://wiki.debian.org/DebianRepository/Format#A.22Release.22_files.
func ParseInRelease ¶
ParseInRelease parses an InRelease file from a Debian Repository.
func (InRelease) ByComponents ¶
func (i InRelease) ByComponents(files FileHashes) Components
ByComponents slices an InRelease file into component/architecture pairs.
func (InRelease) FileHashes ¶
func (i InRelease) FileHashes() (FileHashes, error)
FileHashes obtains the file entries from an InRelease file as a FileHashes.
type InReleaseSum ¶
InReleaseSum is a single checksum entry in an InRelease file.
type Package ¶
type Package struct {
Package string
Version string
Architecture string
Section string
Priority string
InstalledSize uint
Maintainer string
Description string
Homepage *url.URL
Conflicts string
Depends string
Recommends string
Provides string
Replaces string
MD5sum string
SHA1 string
SHA256 string
SHA512 string
Size uint
Filename string
Warnings []error
}
Package is a single package entry in a Packages file.
type Packages ¶
type Packages []Package
Packages is an entire Packages file.
func (Packages) Diff ¶
func (p Packages) Diff(n Packages) PackagesDiff
type PackagesBytes ¶
type PackagesDiff ¶
type Source ¶
type Source struct {
Package string
Format string
Binary string
Architecture string
Version string
Maintainer string
StandardsVersion string
BuildDepends string
Homepage *url.URL
VcsBrowser *url.URL
VcsGit *url.URL
Directory string
PackageList []string
Files []SourceSum
ChecksumsSha1 []SourceSum
ChecksumsSha256 []SourceSum
ChecksumsSha512 []SourceSum
Warnings []error
}
Source is a single entry in a Sources file.
func (Source) FileHashes ¶
func (s Source) FileHashes() (FileHashes, error)
FileHash turns a Source info a FileHashes.