store

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 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 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"`
	Arch         limayaml.Arch      `json:"arch"`
	CPUs         int                `json:"cpus,omitempty"`
	Memory       int64              `json:"memory,omitempty"` // bytes
	Disk         int64              `json:"disk,omitempty"`   // bytes
	Message      string             `json:"message,omitempty"`
	Networks     []limayaml.Network `json:"network,omitempty"`
	SSHLocalPort int                `json:"sshLocalPort,omitempty"`
	HostAgentPID int                `json:"hostAgentPID,omitempty"`
	QemuPID      int                `json:"qemuPID,omitempty"`
	Errors       []error            `json:"errors,omitempty"`
}

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)

type Status

type Status = string
const (
	StatusUnknown Status = ""
	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