limautil

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const EnvLimaDrivers = "LIMA_DRIVERS_PATH"

EnvLimaDrivers is the environment variable for the path to external Lima drivers.

View Source
const EnvLimaHome = "LIMA_HOME"

EnvLimaHome is the environment variable for the Lima directory.

View Source
const LimactlCommand = "limactl"

LimactlCommand is the limactl command.

View Source
const NetInterface = "col0"

network interface for shared network in the virtual machine.

View Source
const NetMetric uint32 = 300

network metric for the route

View Source
const NetMetricPreferred uint32 = 100

Variables

This section is empty.

Functions

func ColimaDiffDisk added in v0.5.3

func ColimaDiffDisk(profileID string) string

ColimaDiffDisk returns path to the diffdisk for the colima VM.

func CreateDisk added in v0.7.4

func CreateDisk(size int) error

CreateDisk creates a lima disk with size in GiB.

func DeleteDisk added in v0.7.4

func DeleteDisk() error

DeleteDisk deletes lima disk for the current instance.

func DiskProvisioned added in v0.9.0

func DiskProvisioned(runtime string) bool

DiskPrivisioned returns if the disk exists and has been provisioned for the specified runtime.

func DownloadImage added in v0.7.0

func DownloadImage(arch environment.Arch, runtime string) (f limaconfig.File, err error)

DownloadImage downloads the image for arch and runtime.

func HasDisk added in v0.7.4

func HasDisk() bool

HasDisk checks if a lima disk exists for the current instance.

func IPAddress

func IPAddress(profileID string) string

IPAddress returns the ip address for profile. It returns the PTP address if networking is enabled or falls back to 127.0.0.1. It is guaranteed to return a value.

TODO: unnecessary round-trip is done to get instance details from Lima.

func Image added in v0.8.1

func Image(arch environment.Arch, runtime string) (limaconfig.File, error)

Image returns the details of the disk image to download for the arch and runtime.

func ImageCached added in v0.7.0

func ImageCached(arch environment.Arch, runtime string) (limaconfig.File, bool)

ImageCached returns if the image for architecture and runtime has been previously downloaded and cached.

func InternalIPAddress added in v0.9.0

func InternalIPAddress(profileID string) string

InternalIPAddress returns the internal IP address for the profile.

func Limactl added in v0.6.0

func Limactl(args ...string) *exec.Cmd

Limactl prepares a limactl command.

func MountPoint added in v0.9.0

func MountPoint() string

MountPoint returns the lima disk mount point for the current instance.

func NetworkAssetsDirectory added in v0.8.1

func NetworkAssetsDirectory() string

NetworkAssetsDirecotry returns the directory for the generated network assets.

func NetworkFile added in v0.6.2

func NetworkFile() string

NetworkFile returns path to the network file.

func ResizeDisk added in v0.9.0

func ResizeDisk(size int) error

ResizeDisk resizes disk to new size

func ShowSSH

func ShowSSH(profileID string) (resp struct {
	Output string
	File   struct {
		Lima   string
		Colima string
	}
}, err error)

ShowSSH runs the show-ssh command in Lima. returns the ssh output, if in layer, and an error if any

Types

type InstanceInfo

type InstanceInfo struct {
	Name    string `json:"name,omitempty"`
	Status  string `json:"status,omitempty"`
	Arch    string `json:"arch,omitempty"`
	CPU     int    `json:"cpus,omitempty"`
	Memory  int64  `json:"memory,omitempty"`
	Disk    int64  `json:"disk,omitempty"`
	Dir     string `json:"dir,omitempty"`
	Network []struct {
		VNL       string `json:"vnl,omitempty"`
		Interface string `json:"interface,omitempty"`
	} `json:"network,omitempty"`
	IPAddress string `json:"address,omitempty"`
	Runtime   string `json:"runtime,omitempty"`
}

InstanceInfo is the information about a Lima instance

func Instance

func Instance() (InstanceInfo, error)

Instance returns current instance.

func Instances

func Instances(ids ...string) ([]InstanceInfo, error)

Instances returns Lima instances created by colima.

func RunningInstances added in v0.8.1

func RunningInstances() ([]InstanceInfo, error)

RunningInstances return Lima instances that are has a running status.

func (InstanceInfo) Config

func (i InstanceInfo) Config() (config.Config, error)

Config returns the current Colima config

func (InstanceInfo) Running

func (i InstanceInfo) Running() bool

Running checks if the instance is running.

type LimaNetwork added in v0.10.0

type LimaNetwork struct {
	Networks struct {
		UserV2 LimaNetworkConfig `yaml:"user-v2"`
	} `yaml:"networks"`
}

type LimaNetworkConfig added in v0.10.0

type LimaNetworkConfig struct {
	Mode    string `yaml:"mode"`
	Gateway net.IP `yaml:"gateway"`
	Netmask string `yaml:"netmask"`
}

Jump to

Keyboard shortcuts

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