Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type AptRelease ¶
type AptRelease struct {
Origin string `json:"origin"`
Label string `json:"label"`
Suite string `json:"suite"`
Codename string `json:"codename,omitempty"`
Date time.Time `json:"date,omitzero"`
AcquireByHash bool `json:"acquire-by-hash"`
Archs []string `json:"architectures,omitempty"`
Components []string `json:"components,omitempty"`
Description string `json:"description,omitempty"`
Extra map[string]string `json:"extra,omitempty"`
MD5 ReleaseSum `json:"md5,omitempty"`
SHA1 ReleaseSum `json:"sha1,omitempty"`
SHA256 ReleaseSum `json:"sha256,omitempty"`
SHA512 ReleaseSum `json:"sha512,omitempty"`
}
Release file from dists/<Suite>/Release, dists/<Suite>/InRelease or dists/<Suite>/Release.gpg
type AptSource ¶
type AptSource struct {
Enabled bool `json:"enabled"` // Repository is enabled
Types []string `json:"source_type"` // Files origem, example: deb, deb-src
URIs []*url.URL `json:"uris"` // Repository Root URL
Suites []string `json:"suites"` // Repository suite or dist name
Components []string `json:"components"` // Repository Components
SignedBy string `json:"signed_by,omitempty"` // GPG Key path
Arch string `json:"arch,omitempty"` // Arch to get Packages
Extra map[string]string `json:"extra"` // Other options
}
APT repository source from sources.list(5) or deb822 file
func ParseDeb822 ¶
Return source list in deb822 file format
func ParseOneLine ¶
Return source list from one line style
func ParseSourcelist ¶
Process Debian sources in one line or deb822 styles
func (AptSource) Release ¶
func (apt AptSource) Release() (SuiteAptRelease, error)
Get *AptRelease from AptSource.Suites
type ReleaseSum ¶
ReleaseSum represents a mapping from a string key (such as a file name or section name) to a slice of Sum values, where each Sum contains checksum information for the corresponding entry. This is typically used to store and organize checksums for files listed in an APT Release file.
func SumLines ¶
func SumLines(data string) (ReleaseSum, error)
SumLines parses a string containing multiple checksum lines (typically from a Debian Release file) and returns a ReleaseSum map containing the parsed sums. Each line is expected to contain a hash, a size, and a filename, separated by spaces. The function splits each line, extracts the hash, size, and file name, and appends the result to the ReleaseSum map keyed by the file name without its extension. Returns an error if any size value cannot be parsed as an integer.
type SuiteAptRelease ¶
type SuiteAptRelease map[string]*AptRelease