apt

package
v0.0.0-...-4732ae8 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Discover

func Discover(archiveRoot string) ([]sources.Entry, error)

Discover attempts to find valid distributions and components in an APT repository by making educated guesses based on common patterns. It tries to balance making fewer requests while returning multiple results when possible.

The input can be either an archive root URL (e.g., "https://example.com/ubuntu") or a distribution root URL (e.g., "https://example.com/ubuntu/dists/jammy"). If a distribution URL is detected, it will be used directly and the archive root will be inferred.

Types

type MountOption

type MountOption func(*MountOptions)

MountOption is a functional option for configuring Mount behavior

func WithArchitectures

func WithArchitectures(architectures ...string) MountOption

WithArchitectures sets the target architectures for the repository

func WithComponents

func WithComponents(components ...string) MountOption

WithComponents sets the components for MountURL (adds to MountOptions)

func WithRegistry

func WithRegistry(registry *apttransport.Registry) MountOption

WithRegistry sets a specific transport registry to use for the repository

func WithTransport

func WithTransport(transport apttransport.Transport) MountOption

WithTransport sets a specific transport to use for the repository

type MountOptions

type MountOptions struct {
	Architectures []string
	Components    []string
	Transport     apttransport.Transport
	Registry      *apttransport.Registry
}

MountOptions contains configuration options for mounting a repository

type Repository

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

https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_debian_archive_basics

func Mount

func Mount(source sources.Entry, optFns ...MountOption) (*Repository, error)

func MountURL

func MountURL(archiveRoot *url.URL, distribution string, optFns ...MountOption) (*Repository, error)

MountURL is a convenience function that creates a Repository from basic parameters. It creates a "deb" type source entry with the specified options.

func (*Repository) DistributionRoot

func (r *Repository) DistributionRoot() *url.URL

func (*Repository) Fetch

THINK: should fetch happen at the Transport layer?

func (*Repository) GetAvailableArchitectures

func (r *Repository) GetAvailableArchitectures(components []string) []string

GetAvailableArchitectures returns all architectures available for the specified components

func (*Repository) Packages

func (r *Repository) Packages(ctx context.Context) iter.Seq2[*deb822.Package, error]

func (*Repository) Release

func (r *Repository) Release() *deb822.Release

Release returns the Release metadata for the repository. The Release file is fetched during mounting, so this should always return a valid result.

func (*Repository) Transport

func (r *Repository) Transport() apttransport.Transport

func (*Repository) Update

func (r *Repository) Update(ctx context.Context) (*deb822.Release, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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