resolver

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package resolver provides pack binary resolution and caching.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FetchResult added in v0.5.0

type FetchResult struct {
	// Version is the concrete resolved release tag with any leading "v" stripped.
	Version string
	// BinaryPath is the absolute path to the extracted pack binary.
	BinaryPath string
}

FetchResult is returned by Fetch after a remote pack has been downloaded, verified, and extracted.

type PackConfig

type PackConfig struct {
	Name    string
	Source  string
	Version string
}

PackConfig represents configuration for a remote pack to resolve.

type Resolver

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

Resolver downloads, caches, and resolves pack binaries.

func NewResolver

func NewResolver(dataDir string) (*Resolver, error)

NewResolver creates a new Resolver caching packs under <dataDir>/packs/.

func NewResolverWithCacheDir

func NewResolverWithCacheDir(cacheDir string) (*Resolver, error)

NewResolverWithCacheDir creates a new Resolver with a custom cache directory.

func (*Resolver) CacheDir

func (r *Resolver) CacheDir() string

CacheDir returns the cache directory path.

func (*Resolver) Fetch added in v0.5.0

func (r *Resolver) Fetch(ctx context.Context, source, version, destDir string) (FetchResult, error)

Fetch resolves a remote pack release via the GitHub Releases API, downloads and checksum-verifies the platform archive, and extracts the binary into destDir. version may be empty to resolve the latest release. It returns the concrete resolved version and the extracted binary path.

func (*Resolver) GetManifest

func (r *Resolver) GetManifest(ctx context.Context, packPath string) (*pack.ManifestResponse, error)

GetManifest calls the pack's manifest command and parses the response. This is the shared helper used at install time to derive a pack's identity.

func (*Resolver) Resolve

func (r *Resolver) Resolve(ctx context.Context, cfg PackConfig) (string, error)

Resolve returns the path to a remote pack binary, downloading if needed. At runtime the binary is normally already cached (populated at install), so this is a cache hit; on a miss it re-fetches the pinned release.

Jump to

Keyboard shortcuts

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