apk

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 15 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package apk implements a SystemDecomposer that reads the installed-package database used by apk-based distributions (Alpine, Wolfi, ...).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decomposer

type Decomposer struct{}

Decomposer reads the apk database from a system filesystem and emits a protobom NodeList of the installed packages.

func New

func New() *Decomposer

New returns a ready-to-use apk decomposer.

func (*Decomposer) DefaultOptions

func (d *Decomposer) DefaultOptions() any

DefaultOptions returns the driver-level options used when none are set on DecomposerOptions.

func (*Decomposer) Extract

func (d *Decomposer) Extract(opts *api.DecomposerOptions) (*sbom.NodeList, error)

Extract opens opts.WorkDir as the system root and runs the FS-aware extractor against it. This lets the decomposer satisfy api.Decomposer for callers that work with on-disk paths; the SystemPackages unpacker calls ExtractFromFS directly so it can pass in non-OS filesystems too.

func (*Decomposer) ExtractFromFS

func (d *Decomposer) ExtractFromFS(source fs.FS, opts *api.DecomposerOptions) (*sbom.NodeList, error)

ExtractFromFS reads the apk database from source and returns the installed packages as a NodeList. Returns (nil, nil) when no apk database is present in the filesystem — apk is not the only system-package format we support and its absence is not an error.

func (*Decomposer) GenerationContext added in v0.4.1

func (d *Decomposer) GenerationContext() api.GenerationContext

GenerationContext says in what context the decomposer's data is read: the package database of a filesystem already put together.

func (*Decomposer) Requirements

func (d *Decomposer) Requirements(_ *api.DecomposerOptions) []api.Requirement

Requirements returns the decomposer's runtime requirements. The apk database is plain text, so there are none.

type Options

type Options struct {
	// DBPaths overrides the default search locations for the apk installed
	// database. Paths are relative to the FS root.
	DBPaths []string
}

Options configures the apk decomposer.

Jump to

Keyboard shortcuts

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