repository

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 20 Imported by: 7

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 ArchiveFromIndex(apkindex *ApkIndex) (archive io.Reader, err error)

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

type ApkIndex struct {
	Signature   []byte
	Description string
	Packages    []*Package
}

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

func ParsePackage(apkPackage io.Reader) (*Package, error)

ParsePackage parses a .apk file and returns a Package struct

func ParsePackageIndex

func ParsePackageIndex(apkIndexUnpacked io.Reader) (packages []*Package, err error)

ParsePackageIndex parses a plain (uncompressed) APKINDEX file. It returns an ApkIndex struct

func (*Package) ChecksumString added in v0.6.0

func (p *Package) ChecksumString() string

ChecksumString returns a human-readable version of the checksum.

func (*Package) Filename

func (p *Package) Filename() string

Returns the package filename as it's named in a repository.

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.

Jump to

Keyboard shortcuts

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