Documentation
¶
Index ¶
- func Discover(archiveRoot string) ([]sources.Entry, error)
- type MountOption
- type MountOptions
- type Repository
- func (r *Repository) DistributionRoot() *url.URL
- func (r *Repository) Fetch(ctx context.Context, loc *url.URL) (io.Reader, *apttransport.AcquireResponse, error)
- func (r *Repository) GetAvailableArchitectures(components []string) []string
- func (r *Repository) Packages(ctx context.Context) iter.Seq2[*deb822.Package, error]
- func (r *Repository) Release() *deb822.Release
- func (r *Repository) Transport() apttransport.Transport
- func (r *Repository) Update(ctx context.Context) (*deb822.Release, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Discover ¶
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 ¶
func (r *Repository) Fetch(ctx context.Context, loc *url.URL) (io.Reader, *apttransport.AcquireResponse, error)
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) 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