lima

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequiredMacOSVersion = "13.0.0"
)
View Source
const (
	VersionRequired = ">= 0.15.0"
)

Variables

View Source
var (
	ConfigErr = errors.New("Could not write Lima config file")
	IpErr     = errors.New("Could not determine IP address for VM instance")
)
View Source
var (
	ConfigPathError    = errors.New("could not create config directory")
	UnsupportedOSError = errors.New("Unsupported OS or macOS version. The macOS Virtualization Framework requires macOS 13.0 (Ventura) or later.")
)
View Source
var ConfigTemplate string
View Source
var UbuntuImages = map[string][]Image{
	"18.04": {
		{
			Alias:    "bionic",
			Location: "https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img",
			Arch:     "x86_64",
		},
		{
			Alias:    "bionic",
			Location: "https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-arm64.img",
			Arch:     "aarch64",
		},
	},
	"20.04": {
		{
			Alias:    "focal",
			Location: "https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64.img",
			Arch:     "x86_64",
		},
		{
			Alias:    "focal",
			Location: "https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-arm64.img",
			Arch:     "aarch64",
		},
	},
	"22.04": {
		{
			Alias:    "jammy",
			Location: "https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img",
			Arch:     "x86_64",
		},
		{
			Alias:    "jammy",
			Location: "https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-arm64.img",
			Arch:     "aarch64",
		},
	},
}

Functions

func Installed

func Installed() error

Types

type Config

type Config struct {
	Images       []Image       `yaml:"images"`
	PortForwards []PortForward `yaml:"portForwards"`
}

type Image

type Image struct {
	Alias    string
	Location string `yaml:"location"`
	Arch     string `yaml:"arch"`
}

type Instance

type Instance struct {
	ConfigFile    string
	InventoryFile string
	Sites         map[string]*trellis.Site
	Name          string `json:"name"`
	Status        string `json:"status"`
	Dir           string `json:"dir"`
	Arch          string `json:"arch"`
	Cpus          int    `json:"cpus"`
	Memory        int    `json:"memory"`
	Disk          int    `json:"disk"`
	SshLocalPort  int    `json:"sshLocalPort,omitempty"`
	Config        Config `json:"config"`
	Username      string `json:"username,omitempty"`
}

func (*Instance) CreateConfig

func (i *Instance) CreateConfig() error

func (*Instance) CreateInventoryFile

func (i *Instance) CreateInventoryFile() error

func (*Instance) DeleteConfig added in v1.11.0

func (i *Instance) DeleteConfig() error

func (*Instance) IP

func (i *Instance) IP() (ip string, err error)

Gets the IP address of the instance using the output of `ip route`:

default via 192.168.64.1 proto dhcp src 192.168.64.2 metric 100
192.168.64.0/24 proto kernel scope link src 192.168.64.2
192.168.64.1 proto dhcp scope link src 192.168.64.2 metric 100

func (*Instance) Running

func (i *Instance) Running() bool

func (*Instance) Stopped

func (i *Instance) Stopped() bool

type Manager

type Manager struct {
	ConfigPath    string
	Sites         map[string]*trellis.Site
	HostsResolver vm.HostsResolver
	// contains filtered or unexported fields
}

func NewManager

func NewManager(trellis *trellis.Trellis, ui cli.Ui) (manager *Manager, err error)

func (*Manager) CreateInstance

func (m *Manager) CreateInstance(name string) error

func (*Manager) DeleteInstance

func (m *Manager) DeleteInstance(name string) error

func (*Manager) GetInstance

func (m *Manager) GetInstance(name string) (Instance, bool)

func (*Manager) InventoryPath

func (m *Manager) InventoryPath() string

func (*Manager) OpenShell

func (m *Manager) OpenShell(name string, dir string, commandArgs []string) error

func (*Manager) StartInstance

func (m *Manager) StartInstance(name string) error

func (*Manager) StopInstance

func (m *Manager) StopInstance(name string) error

type PortForward

type PortForward struct {
	GuestPort int `yaml:"guestPort"`
	HostPort  int `yaml:"hostPort"`
}

Jump to

Keyboard shortcuts

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