limadist

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2026 License: Apache-2.0 Imports: 20 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package limadist downloads and installs the pinned Lima release the managed VM runs on.

Index

Constants

View Source
const (
	// EnvBaseURL points the download at a mirror. The checksum stays compiled in.
	EnvBaseURL = "APP_LIMA_DOWNLOAD_BASE"
	// EnvTimeout bounds a whole download.
	EnvTimeout = "APP_LIMA_DOWNLOAD_TIMEOUT"
	// EnvStall bounds the wait for the next bytes.
	EnvStall = "APP_LIMA_DOWNLOAD_STALL_TIMEOUT"
)
View Source
const Version = "2.2.1"

Version is the pinned Lima release. Change it together with the checksums below.

Variables

View Source
var (
	// ErrBusy means another process is installing right now.
	ErrBusy = errors.New("another Lima install is already running")
	// ErrChecksum means the archive is not the pinned release.
	ErrChecksum = errors.New("the download does not match the pinned checksum")
)
View Source
var ErrNotFound = errors.New("limactl not found")

ErrNotFound means there is no limactl anywhere Find looks.

Functions

func Install

func Install(ctx context.Context, o Options) (string, error)

Install fetches, verifies and unpacks the pinned release, and returns its limactl. The tree appears under its version name only once complete; an interrupted download resumes next time.

func PartPath

func PartPath(dataDir string, a Asset) string

PartPath is the partial download, kept until the install finished so it can resume.

func PinnedPath

func PinnedPath(dataDir string) string

PinnedPath is where Install puts the pinned limactl.

Types

type Asset

type Asset struct {
	Name   string
	SHA256 string
	Size   int64
}

Asset is one release archive with the values it must match.

func AssetFor

func AssetFor(goarch string) (Asset, error)

AssetFor returns the pinned macOS archive for a Go architecture name.

type Options

type Options struct {
	DataDir  string
	Arch     string // Go architecture name
	BaseURL  string // empty means the official release page
	Timeout  time.Duration
	Stall    time.Duration
	Client   *http.Client
	Progress func(done, total int64)
	// contains filtered or unexported fields
}

Options configures Install. The expected checksum is deliberately not among them.

func OptionsFromEnv

func OptionsFromEnv(dataDir, arch string, lookup func(string) (string, bool)) (Options, error)

OptionsFromEnv reads the mirror and time limits.

func (Options) URL

func (o Options) URL(a Asset) (string, error)

URL is the address the archive for a is fetched from.

type Source

type Source string

Source says where a limactl was found.

const (
	SourceManaged Source = "managed"
	SourcePath    Source = "path"
)

Sources, in the order Find tries them.

func Find

func Find(dataDir string, lookPath func(string) (string, error)) (string, Source, error)

Find prefers a limactl in the data folder (placed by hand, then the pinned download, then an older download so an app update never loses a working one) and falls back to PATH.

Jump to

Keyboard shortcuts

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