Documentation
¶
Index ¶
- type BinaryPackage
- type Index
- type IndexHash
- type Release
- type Repository
- func (r *Repository) ForceIndexURL(u string)
- func (r *Repository) GetArchitectures() []string
- func (r *Repository) GetDistribution() string
- func (r *Repository) GetIndex() *Index
- func (r *Repository) GetIndexURL() string
- func (r *Repository) GetPackages() ([]BinaryPackage, error)
- func (r *Repository) GetRelease() *Release
- func (r *Repository) GetReleaseURL() string
- func (r *Repository) IsFlat() bool
- func (r *Repository) ReloadPackages() error
- func (r *Repository) SetArchitecture(arch string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BinaryPackage ¶
type BinaryPackage struct { // mandatory Filename string Size string // optional BinaryPackage string MD5sum string SHA1 string SHA256 string DescriptionMD5 string Depends []string `delim:", " strip:"\n\r\t "` InstalledSize string `control:"Installed-Size"` Package string Architecture string Version string Section string Maintainer string Homepage string Description string Tag string Author string Name string }
BinaryPackage represents all the entry of the Packages file
type Index ¶
type Index struct { Type string Binaries []BinaryPackage }
Index contains the content of Packages files
type IndexHash ¶
IndexHash contains hash and size of a Packages file
func (*IndexHash) UnmarshalControl ¶
UnmarshalControl tells how to unmarshal the control files
type Release ¶
type Release struct { // Optional Description string `control:"Description"` Origin string `control:"Origin"` Label string `control:"Label"` Version string `control:"Version"` Suite string `control:"Suite"` Codename string `control:"Codename"` Components []string `control:"Components"` Architectures []string `control:"Architectures"` Date string `control:"Date"` ValidUntil string `control:"Valid-Until"` PackagePaths []string `control:"-"` MD5Sum []IndexHash `control:"MD5Sum" delim:"\n" strip:"\n\r\t "` SHA1 []IndexHash `control:"SHA1" delim:"\n" strip:"\n\r\t "` SHA256 []IndexHash `control:"SHA256" delim:"\n" strip:"\n\r\t "` }
Release represents the Release file
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository is the object that represents an APT repository
func NewRepository ¶
func NewRepository(ctx context.Context, root string, suite string, userAgent string) (*Repository, error)
NewRepository creates a new Repository object
func (*Repository) ForceIndexURL ¶
func (r *Repository) ForceIndexURL(u string)
ForceIndexURL force the URL of the Packages file to parse bypassing the parsing of the Release
func (*Repository) GetArchitectures ¶
func (r *Repository) GetArchitectures() []string
GetArchitectures returns the architectures found in the Release file
func (*Repository) GetDistribution ¶
func (r *Repository) GetDistribution() string
GetDistribution returns the distribution
func (*Repository) GetIndex ¶
func (r *Repository) GetIndex() *Index
GetIndex returns the parsed Index object
func (*Repository) GetIndexURL ¶
func (r *Repository) GetIndexURL() string
GetIndexURL returns the URL of the Packages file
func (*Repository) GetPackages ¶
func (r *Repository) GetPackages() ([]BinaryPackage, error)
GetPackages returns the binary packages from the Packages file
func (*Repository) GetRelease ¶
func (r *Repository) GetRelease() *Release
GetRelease returns the parsed Release object
func (*Repository) GetReleaseURL ¶
func (r *Repository) GetReleaseURL() string
GetReleaseURL returns the URL of the Release file
func (*Repository) IsFlat ¶
func (r *Repository) IsFlat() bool
IsFlat returns true is the repository is a flat repo
func (*Repository) ReloadPackages ¶
func (r *Repository) ReloadPackages() error
ReloadPackages parses again the Packages file
func (*Repository) SetArchitecture ¶
func (r *Repository) SetArchitecture(arch string) error
SetArchitecture sets the architecture to parse the corrispondent Packages file