Documentation ¶
Overview ¶
Package repository provides implements parsing of apk repositories
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArchiveFromIndex ¶ added in v0.6.0
func SignArchive ¶ added in v0.9.0
func SignArchive(archive io.Reader, privateKey *rsa.PrivateKey, keyName string) (signedArchive io.Reader, err error)
SignArchive signs an unsigned APKINDEX archive e.g. APKINDEX.unsigned.tar.gz.
Types ¶
type ApkIndex ¶
func IndexFromArchive ¶
func IndexFromArchive(archive io.ReadCloser) (apkindex *ApkIndex, err error)
type Package ¶
type Package struct { Name string Version string Arch string Description string License string Origin string Maintainer string URL string Checksum []byte Dependencies []string Provides []string InstallIf []string Size uint64 InstalledSize uint64 ProviderPriority uint64 BuildTime time.Time RepoCommit string Replaces string }
Package represents a single package with the information present in an APKINDEX.
func ParsePackage ¶ added in v0.6.0
ParsePackage parses a .apk file and returns a Package struct
func ParsePackageIndex ¶
ParsePackageIndex parses a plain (uncompressed) APKINDEX file. It returns an ApkIndex struct
func (*Package) ChecksumString ¶ added in v0.6.0
ChecksumString returns a human-readable version of the checksum.
type Repository ¶
type Repository struct {
Uri string
}
func NewRepositoryFromComponents ¶
func NewRepositoryFromComponents(baseUri, release, repo, arch string) Repository
NewRepositoryFromComponents creates a new Repository with the uri constructed from the individual components
func (*Repository) IndexUri ¶
func (r *Repository) IndexUri() string
IndexUri returns the uri of the APKINDEX for this repository
func (*Repository) IsRemote ¶
func (r *Repository) IsRemote() bool
IsRemote returns whether the repository is considered remote and needs to be fetched over http(s)
func (*Repository) WithIndex ¶
func (r *Repository) WithIndex(index *ApkIndex) *RepositoryWithIndex
WithIndex returns a RepositoryWithIndex object with the
type RepositoryPackage ¶
type RepositoryPackage struct { *Package // contains filtered or unexported fields }
func NewRepositoryPackage ¶
func NewRepositoryPackage(pkg *Package, repo *RepositoryWithIndex) *RepositoryPackage
func (*RepositoryPackage) Repository ¶
func (rp *RepositoryPackage) Repository() *RepositoryWithIndex
func (*RepositoryPackage) Url ¶
func (rp *RepositoryPackage) Url() string
type RepositoryWithIndex ¶
type RepositoryWithIndex struct { *Repository // contains filtered or unexported fields }
RepositoryWithIndex represents a repository with the index read and parsed
func (*RepositoryWithIndex) Count ¶
func (r *RepositoryWithIndex) Count() int
Count returns the amout of packages that are available in this repository
func (*RepositoryWithIndex) Packages ¶
func (r *RepositoryWithIndex) Packages() (pkgs []*RepositoryPackage)
Packages returns a list of RepositoryPackage in this repository
func (*RepositoryWithIndex) RepoAbbr ¶
func (r *RepositoryWithIndex) RepoAbbr() string
RepoAbbr returns a short name of this repository consiting of the repo name and the architecture.