apk

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IndexTar   = "APKINDEX.tar.gz"
	IndexFile  = "APKINDEX"
	PackageExt = ".apk"
	PubKeyExt  = ".rsa.pub"
)

ABuild default values for packages and indexes

Variables

This section is empty.

Functions

This section is empty.

Types

type Index

type Index struct {
	Packages []Package
}

Index represents the content of the APKINDEX file in an index tar

type Package

type Package struct {
	C             string    `apk:"C" json:"-"`
	Package       string    `apk:"P" json:"name"`
	Version       string    `apk:"V" json:"version"`
	Description   string    `apk:"T" json:"description"`
	Arch          string    `apk:"A" json:"arch"`
	PackageSize   string    `apk:"S" json:"size"`
	InstalledSize string    `apk:"I" json:"installed_size"`
	URL           string    `apk:"U" json:"url"`
	License       string    `apk:"L" json:"license"`
	Origin        string    `apk:"o" json:"origin"`
	Maintainer    string    `apk:"m" json:"maintainer"`
	BuildTime     time.Time `apk:"t" json:"build_time"`
	Commit        string    `apk:"c" json:"build_commit"`
	Dependencies  []string  `apk:"D" json:"dependencies"`
	Provides      []string  `apk:"p" json:"provides"`
	APK           string    `apk:"-" json:"apk_url"`
}

Package defines a package entry in an APKINDEX file

func ListPackageFromIndex

func ListPackageFromIndex(o io.Reader) ([]Package, error)

ListPackageFromIndex reads an APKINDEX.tar.gz and return a list of packages

type Repository

type Repository struct {
	storage.Service `json:"-"`

	Name   string   `json:"name"`
	Arch   []string `json:"available_arch"`
	Prefix string   `json:"storage_prefix"`
	Keys   []string `json:"public_keys"`

	KeyName map[string]string `json:"-"`
}

Repository defines an APK repository configuration and underlying storage

func (*Repository) HasArch

func (r *Repository) HasArch(arch string) bool

HasArch allows verification that a specific arch is available in this repository

func (*Repository) Init

func (r *Repository) Init(store storage.Service) error

Init configure a Repository using the passed storage.Service and its current configuration

func (*Repository) ListPackages

func (r *Repository) ListPackages(ctx context.Context, arch string) ([]Package, error)

ListPackages returns the list of available package in the repository based on the passed arch

Jump to

Keyboard shortcuts

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