pkgdownload

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: UNKNOWN not legal advice Imports: 0 Imported by: 0

Documentation

Overview

Package pkgdownload provides interfaces and utility functions to download gno packages files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Download

func Download(pkgPath string, dst string, fetcher PackageFetcher) error

Download downloads the package identified by `pkgPath` in the directory at `dst` using the provided PackageFetcher. The directory at `dst` is created if it does not exists.

Types

type InMemoryFetcher

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

InMemoryFetcher is a PackageFetcher backed by a map of pre-registered MemPackages. Primarily intended for tests where network/filesystem access is undesirable.

InMemoryFetcher is read-only after construction. Register all packages when calling NewInMemoryFetcher; concurrent FetchPackage calls are safe. There is intentionally no public API to mutate the map after creation.

func NewInMemoryFetcher

func NewInMemoryFetcher(pkgs ...*std.MemPackage) *InMemoryFetcher

NewInMemoryFetcher registers the given MemPackages by their Path. If two MemPackages share the same Path, the later one wins.

func (*InMemoryFetcher) FetchPackage

func (f *InMemoryFetcher) FetchPackage(pkgPath string) ([]*std.MemFile, error)

FetchPackage implements PackageFetcher.

type PackageFetcher

type PackageFetcher interface {
	FetchPackage(pkgPath string) ([]*std.MemFile, error)
}

func NewNoopFetcher

func NewNoopFetcher() PackageFetcher

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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