run

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

README

Shamelessly taken from linuxkit

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HetznerCmd = &cobra.Command{
		Use:   "hetzner [options] image-path",
		Short: "Run the virtual machine image on Hetzner Cloud",
		Args:  cobra.ExactArgs(1),
		Run:   Hetzner,
	}
)
View Source
var (
	QemuCmd = &cobra.Command{
		Use:   "qemu [options] [image-path]",
		Short: "Run the virtual machine image with qemu",
		Args:  cobra.ExactArgs(1),
		Run:   Qemu,
	}
)
View Source
var (
	VboxCmd = &cobra.Command{
		Use:   "vbox [options] image-path",
		Short: "Run the virtual machine image with Virtualbox",
		Args:  cobra.ExactArgs(1),
		Run:   Vbox,
	}
)

Functions

func ConvertMBtoGB

func ConvertMBtoGB(i int) int

func GetBoolValue

func GetBoolValue(envKey string, flagVal bool) bool

func GetDiskSizeMB

func GetDiskSizeMB(s string) (int, error)

This function parses the "size" parameter of a disk specification and returns the size in MB. The "size" parameter defaults to GB, but the unit can be explicitly set with either a G (for GB) or M (for MB). It returns the disk size in MB.

func GetIntValue

func GetIntValue(envKey string, flagVal int, defaultVal int) int

func GetStringValue

func GetStringValue(envKey string, flagVal string, defaultVal string) string

func Hetzner

func Hetzner(cmd *cobra.Command, args []string)

func Qemu

func Qemu(cmd *cobra.Command, args []string)

func SplitLines

func SplitLines(in string) []string

Convert a multi-line string into an array of strings

func StringToIntArray

func StringToIntArray(l string, sep string) ([]int, error)

func Vbox

func Vbox(cmd *cobra.Command, args []string)

Types

type Disks

type Disks []qemu.Disk

Disks is the type for a list of DiskConfig

func (*Disks) Set

func (l *Disks) Set(value string) error

Set is used by flag to configure value from CLI

func (*Disks) String

func (l *Disks) String() string

func (*Disks) Type

func (l *Disks) Type() string

type MultipleFlag

type MultipleFlag []string

Handle flags with multiple occurrences

func (*MultipleFlag) Set

func (f *MultipleFlag) Set(value string) error

func (*MultipleFlag) String

func (f *MultipleFlag) String() string

func (*MultipleFlag) Type

func (f *MultipleFlag) Type() string

type PublishedPort

type PublishedPort struct {
	Guest    uint16
	Host     uint16
	Protocol string
}

PublishedPort is used by some backends to expose a VMs port on the host

func NewPublishedPort

func NewPublishedPort(publish string) (PublishedPort, error)

NewPublishedPort parses a string of the form <host>:<guest>[/<tcp|udp>] and returns a PublishedPort structure

type VBNetwork

type VBNetwork struct {
	Type    string
	Adapter string
}

VBNetwork is the config for a Virtual Box network

type VBNetworks

type VBNetworks []VBNetwork

VBNetworks is the type for a list of VBNetwork

func (*VBNetworks) Set

func (l *VBNetworks) Set(value string) error

Set is used by flag to configure value from CLI

func (*VBNetworks) String

func (l *VBNetworks) String() string

func (*VBNetworks) Type

func (l *VBNetworks) Type() string

Jump to

Keyboard shortcuts

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