store

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2022 License: MIT Imports: 10 Imported by: 0

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 MacVZDir.

func LoadYAMLByFilePath

func LoadYAMLByFilePath(filePath string) (*yaml.MacVZYaml, error)

LoadYAMLByFilePath loads and validates the yaml.

func ReadPIDFile

func ReadPIDFile(path string) (int, error)

Types

type FormatData

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

type Instance

type Instance struct {
	Name   string `json:"name"`
	Status Status `json:"status"`
	Dir    string `json:"dir"`
	CPUs   int    `json:"cpus,omitempty"`
	Memory int64  `json:"memory,omitempty"` // bytes
	Disk   int64  `json:"disk,omitempty"`   // bytes

	VZPid  int     `json:"VZPid,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() (*yaml.MacVZYaml, 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