fetch

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package fetch downloads and caches remote files (cloud images, VMM binaries, firmware), verifying an optional SHA256 and writing atomically so a cached file is always complete. It is the shared download primitive behind internal/image and the cloud-hypervisor backend (ADR-0011).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ensure

func Ensure(cacheDir, name, url, sha256hex string) (string, error)

Ensure downloads url into cacheDir/name and returns the path. If the file is already cached it returns immediately. The download goes to a .download temp file that is verified (when sha256hex is non-empty) and atomically renamed, so a partial or mismatched download never leaves a usable file behind. An empty sha256hex skips verification (used by the image catalog's "latest" entries); callers that pin versions pass the digest to make verification mandatory.

Types

This section is empty.

Jump to

Keyboard shortcuts

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