providers

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterBuilder

func RegisterBuilder(name string, provider PackageManager)

RegisterBuilder registers a new package manager LLB builder.

func RegisterResolver

func RegisterResolver(name string, factory func(opts Options) (Resolver, error))

RegisterResolver adds a new resolver factory to the global registry.

Types

type LockedPackage

type LockedPackage struct {
	Name     string `yaml:"name" json:"name"`
	Version  string `yaml:"version" json:"version"`
	Checksum string `yaml:"checksum,omitempty" json:"checksum,omitempty"`
}

LockedPackage defines a single package record in lockfile.

type Lockfile

type Lockfile struct {
	Provider string          `yaml:"provider" json:"provider"`
	Arch     string          `yaml:"arch"     json:"arch"`
	Packages []LockedPackage `yaml:"packages" json:"packages"`
}

Lockfile defines the schema of the doko.lock file.

type Options

type Options struct {
	Arch           string
	Repositories   []string
	LockedPackages map[string]string
	CACerts        [][]byte
	Timeout        time.Duration
	OSVersion      string
	Client         client.Client
}

Options sets configuration for constructing resolvers.

type Package

type Package struct {
	Name         string   `json:"name"`
	Version      string   `json:"version"`
	Arch         string   `json:"arch"`
	License      string   `json:"license"`
	Description  string   `json:"description,omitempty"`
	DownloadURL  string   `json:"download_url"`
	Checksum     string   `json:"checksum,omitempty"`
	Dependencies []string `json:"dependencies,omitempty"`
	Size         int64    `json:"size,omitempty"`
}

Package represents a resolved dependency from any package ecosystem.

type PackageManager

type PackageManager interface {
	Name() string
	ResolveBaseImage(base string) string
	KeyringDest(filename string) string
	CACertDest(filename string) string
	UpdateCACertCommand() []string
	InstallScript(installs, removals []string) string
	CacheMounts() []buildkitllb.RunOption
	RemovePaths() []string
	BuildPackage(ctx context.Context, spec *config.BuildSpec, sourceState buildkitllb.State, resolver buildkitllb.ImageMetaResolver, opts ...buildkitllb.ConstraintsOpt) (buildkitllb.State, error)
	AssemblePackage(dataDir, outPath string, spec *config.BuildSpec, arch string) (string, error)
}

PackageManager defines the interface for pluggable package managers to construct LLB graphs.

func GetBuilder

func GetBuilder(name string) (PackageManager, error)

GetBuilder retrieves a registered PackageManager builder by name.

type Resolver

type Resolver interface {
	Name() string
	Resolve(ctx context.Context, packages []string) ([]Package, error)
}

Resolver is the interface that all package providers must implement for dependency parsing.

func NewResolver

func NewResolver(provider string, opts Options) (Resolver, error)

NewResolver constructs a resolver for the given provider name and options.

Directories

Path Synopsis
apk
Package apk implements the Alpine APK package resolver for Doko.
Package apk implements the Alpine APK package resolver for Doko.

Jump to

Keyboard shortcuts

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