Documentation
¶
Index ¶
- func ArtifactURL(version, artifact string) string
- func ClearCachedTools(toolsDir string) error
- func DownloadVersion(ctx context.Context, toolsDir, version string) error
- func EnsureFCKernel(ctx context.Context, toolsDir string) (string, error)
- func Exist(toolsDir string) bool
- func FCKernelExists(toolsDir string) bool
- func FCKernelPath(toolsDir string) string
- func IsNewer(local, remote string) bool
- func ListRemoteVersions(ctx context.Context) ([]string, error)
- func LocalVersion(toolsDir string) string
- func RemoteVersion(ctx context.Context) (string, error)
- func ResolveDump(ctx context.Context, toolsDir, override string) (string, error)
- func ResolveMkfs(ctx context.Context, toolsDir, override string) (image.MkfsFunc, error)
- func SaveLocalVersion(toolsDir, version string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArtifactURL ¶
ArtifactURL returns the download URL for a named artifact at a given semver. version must be in "vMAJOR.MINOR.PATCH" form; artifact is e.g. "kernel.img". Passing version="latest" downloads from the rolling latest release.
func ClearCachedTools ¶
ClearCachedTools deletes the kernel artifacts and version file from toolsDir.
func DownloadVersion ¶
DownloadVersion downloads all kernel artifacts for the given semver into toolsDir and saves the version file. Use version="latest" for the rolling release.
func EnsureFCKernel ¶
EnsureFCKernel downloads kernel-fc.img from the latest release into toolsDir if it is not already present. Returns the local path to the kernel.
func FCKernelExists ¶
FCKernelExists returns true when the Firecracker kernel is present in toolsDir.
func FCKernelPath ¶
FCKernelPath returns the path where the Firecracker-compatible kernel is cached.
func IsNewer ¶
IsNewer reports whether remote is a strictly higher semver than local. Unknown/malformed versions are never treated as newer.
func ListRemoteVersions ¶
ListRemoteVersions returns all available kernel versions from GitHub releases, sorted newest-first by semver.
func LocalVersion ¶
LocalVersion returns the semver string (e.g. "v0.1.0") cached in toolsDir. Returns "(unknown)" if the file is absent or unreadable.
func RemoteVersion ¶
RemoteVersion returns the semver of the latest kernel release on GitHub.
func ResolveDump ¶
ResolveDump returns the path to the dump binary, downloading it from the kernel release if it is not already present in toolsDir. If override is non-empty it is returned as-is without any checks.
func ResolveMkfs ¶
ResolveMkfs returns an image.MkfsFunc ready to invoke.
Downloads the latest kernel artifacts to toolsDir on first use and caches them. If override is non-empty it is used as the mkfs binary path; kernel/boot still come from toolsDir.
func SaveLocalVersion ¶
SaveLocalVersion writes version to toolsDir/kernel-version.txt.
Types ¶
This section is empty.