store

package
v0.18.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: Apache-2.0 Imports: 24 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FormatHelp = "\n" +
	"These functions are available to go templates:\n\n" +
	textutil.IndentString(2,
		strings.Join(textutil.FuncHelp, "\n")+"\n")

Functions

func DiskDir added in v0.14.0

func DiskDir(name string) (string, error)

func Disks added in v0.14.0

func Disks() ([]string, error)

func GetSSHAddress added in v0.18.0

func GetSSHAddress(_ string) (string, error)

func InstanceDir

func InstanceDir(name string) (string, error)

InstanceDir returns the instance dir. InstanceDir does not check whether the instance exists

func Instances

func Instances() ([]string, error)

Instances returns the names of the instances under LimaDir.

func LoadYAMLByFilePath

func LoadYAMLByFilePath(filePath string) (*limayaml.LimaYAML, error)

LoadYAMLByFilePath loads and validates the yaml.

func PrintInstances added in v0.15.0

func PrintInstances(w io.Writer, instances []*Instance, format string, options *PrintOptions) error

PrintInstances prints instances in a requested format to a given io.Writer. Supported formats are "json", "yaml", "table", or a go template

func ReadPIDFile added in v0.7.0

func ReadPIDFile(path string) (int, error)

ReadPIDFile returns 0 if the PID file does not exist or the process has already terminated (in which case the PID file will be removed).

Types

type Disk added in v0.14.0

type Disk struct {
	Name        string `json:"name"`
	Size        int64  `json:"size"`
	Dir         string `json:"dir"`
	Instance    string `json:"instance"`
	InstanceDir string `json:"instanceDir"`
	MountPoint  string `json:"mountPoint"`
}

func InspectDisk added in v0.14.0

func InspectDisk(diskName string) (*Disk, error)

func (*Disk) Lock added in v0.14.0

func (d *Disk) Lock(instanceDir string) error

func (*Disk) Unlock added in v0.14.0

func (d *Disk) Unlock() error

type FormatData added in v0.8.0

type FormatData struct {
	Instance
	HostOS       string
	HostArch     string
	LimaHome     string
	IdentityFile string
}

func AddGlobalFields added in v0.8.0

func AddGlobalFields(inst *Instance) (FormatData, error)

type Instance

type Instance struct {
	Name            string             `json:"name"`
	Status          Status             `json:"status"`
	Dir             string             `json:"dir"`
	VMType          limayaml.VMType    `json:"vmType"`
	Arch            limayaml.Arch      `json:"arch"`
	CPUType         string             `json:"cpuType"`
	CPUs            int                `json:"cpus,omitempty"`
	Memory          int64              `json:"memory,omitempty"` // bytes
	Disk            int64              `json:"disk,omitempty"`   // bytes
	Message         string             `json:"message,omitempty"`
	AdditionalDisks []limayaml.Disk    `json:"additionalDisks,omitempty"`
	Networks        []limayaml.Network `json:"network,omitempty"`
	SSHLocalPort    int                `json:"sshLocalPort,omitempty"`
	SSHConfigFile   string             `json:"sshConfigFile,omitempty"`
	HostAgentPID    int                `json:"hostAgentPID,omitempty"`
	DriverPID       int                `json:"driverPID,omitempty"`
	Errors          []error            `json:"errors,omitempty"`
	Config          *limayaml.LimaYAML `json:"config,omitempty"`
	SSHAddress      string             `json:"sshAddress,omitempty"`
	Protected       bool               `json:"protected"`
}

func Inspect

func Inspect(instName string) (*Instance, error)

Inspect returns err only when the instance does not exist (os.ErrNotExist). Other errors are returned as *Instance.Errors

func (*Instance) LoadYAML

func (inst *Instance) LoadYAML() (*limayaml.LimaYAML, error)

func (*Instance) Protect added in v0.18.0

func (inst *Instance) Protect() error

Protect protects the instance to prohibit accidental removal. Protect does not return an error even when the instance is already protected.

func (*Instance) Unprotect added in v0.18.0

func (inst *Instance) Unprotect() error

Unprotect unprotects the instance. Unprotect does not return an error even when the instance is already unprotected.

type PrintOptions added in v0.15.0

type PrintOptions struct {
	AllFields     bool
	TerminalWidth int
}

type Status

type Status = string
const (
	StatusUnknown       Status = ""
	StatusUninitialized Status = "Uninitialized"
	StatusInstalling    Status = "Installing"
	StatusBroken        Status = "Broken"
	StatusStopped       Status = "Stopped"
	StatusRunning       Status = "Running"
)

Directories

Path Synopsis
Package filenames defines the names of the files that appear under an instance dir or inside the config directory.
Package filenames defines the names of the files that appear under an instance dir or inside the config directory.

Jump to

Keyboard shortcuts

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