apk

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package apk provides a registry client for Alpine APK repositories.

Index

Constants

View Source
const (
	DefaultURL = ""
)

Variables

View Source
var (
	// ErrV3IndexUnsupported is returned when a repository publishes a v3
	// Packages.adb index, which this client does not decode yet.
	ErrV3IndexUnsupported = errors.New("apk v3 Packages.adb indexes are not supported")
	// ErrMalformedIndex is returned for indexes that cannot be parsed.
	ErrMalformedIndex = errors.New("malformed APKINDEX")
)

Functions

This section is empty.

Types

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry reads one repository architecture directory, such as https://dl-cdn.alpinelinux.org/alpine/v3.23/main/x86_64, or an exact index URL inside one. The release, component and architecture are never inferred from a higher-level mirror URL.

The index is downloaded once per Registry and kept for its lifetime, so callers looking up many packages should reuse one Registry per repository.

func New

func New(baseURL string, client *core.Client) *Registry

func (*Registry) Ecosystem

func (r *Registry) Ecosystem() string

func (*Registry) FetchDependencies

func (r *Registry) FetchDependencies(ctx context.Context, name, version string) ([]core.Dependency, error)

func (*Registry) FetchMaintainers

func (r *Registry) FetchMaintainers(ctx context.Context, name string) ([]core.Maintainer, error)

func (*Registry) FetchPackage

func (r *Registry) FetchPackage(ctx context.Context, name string) (*core.Package, error)

func (*Registry) FetchVersions

func (r *Registry) FetchVersions(ctx context.Context, name string) ([]core.Version, error)

func (*Registry) URLs

func (r *Registry) URLs() core.URLBuilder

type URLs

type URLs struct {
	// contains filtered or unexported fields
}

func (*URLs) Documentation

func (u *URLs) Documentation(name, version string) string

func (*URLs) Download

func (u *URLs) Download(name, version string) string

Download returns the package file beside the index. The name may carry a PURL vendor namespace.

func (*URLs) PURL

func (u *URLs) PURL(name, version string) string

func (*URLs) Registry

func (u *URLs) Registry(name, version string) string

Jump to

Keyboard shortcuts

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