Documentation
¶
Overview ¶
Package resolver provides pack binary resolution and caching.
Index ¶
- type FetchResult
- type PackConfig
- type Resolver
- func (r *Resolver) CacheDir() string
- func (r *Resolver) Fetch(ctx context.Context, source, version, destDir string) (FetchResult, error)
- func (r *Resolver) GetManifest(ctx context.Context, packPath string) (*pack.ManifestResponse, error)
- func (r *Resolver) Resolve(ctx context.Context, cfg PackConfig) (string, error)
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 ¶
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 ¶
NewResolver creates a new Resolver caching packs under <dataDir>/packs/.
func NewResolverWithCacheDir ¶
NewResolverWithCacheDir creates a new Resolver with a custom cache directory.
func (*Resolver) Fetch ¶ added in v0.5.0
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.