limautil

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LayerEnvVar = "COLIMA_LAYER_SSH_PORT"
)

Variables

This section is empty.

Functions

func ColimaStateFile added in v0.4.5

func ColimaStateFile(profileID string) string

ColimaStateFile returns path to the colima state yaml file.

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 InstanceConfig

func InstanceConfig() (config.Config, error)

InstanceConfig returns the current instance config.

func LimaHome added in v0.4.5

func LimaHome() string

LimaHome returns the config directory for Lima.

func ShowSSH

func ShowSSH(profileID string, layer bool, format string) (resp struct {
	Output    string
	IPAddress string
	Layer     bool
}, 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() ([]InstanceInfo, error)

Instances returns Lima instances created by colima.

func (InstanceInfo) Config

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

func (InstanceInfo) Running

func (i InstanceInfo) Running() bool

Jump to

Keyboard shortcuts

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