hyperkit

package
v0.12.12 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DriverName    = "hyperkit"
	DriverVersion = "0.12.12"

	DefaultMemory  = 8192
	DefaultCPUs    = 4
	DefaultSSHUser = "core"
)
View Source
const (
	// LeasesPath is the path to dhcpd leases
	LeasesPath = "/var/db/dhcpd_leases"
	// VMNetDomain is the domain for vmnet
	VMNetDomain = "/Library/Preferences/SystemConfiguration/com.apple.vmnet"
	// SharedNetAddrKey is the key for the network address
	SharedNetAddrKey = "Shared_Net_Address"
)

Variables

This section is empty.

Functions

func GetIPAddressByMACAddress

func GetIPAddressByMACAddress(mac string) (string, error)

GetIPAddressByMACAddress gets the IP address of a MAC address

func GetMACAddressFromUUID

func GetMACAddressFromUUID(id string) (string, error)

func GetNetAddr

func GetNetAddr() (net.IP, error)

GetNetAddr gets the network address for vmnet

func RetryAfter

func RetryAfter(attempts int, callback func() error, d time.Duration) (err error)

RetryAfter retries a number of attempts, after a delay

Types

type DHCPEntry

type DHCPEntry struct {
	Name      string
	IPAddress string
	HWAddress string
	ID        string
	Lease     string
}

DHCPEntry holds a parsed DNS entry

type Driver

type Driver hyperkitdriver.Driver

func NewDriver

func NewDriver() *Driver

NewDriver creates a new driver for a host

func (*Driver) Create

func (d *Driver) Create() error

Create a host using the driver's config

func (*Driver) DriverName

func (d *Driver) DriverName() string

DriverName returns the name of the driver

func (*Driver) DriverVersion

func (d *Driver) DriverVersion() string

func (*Driver) GetState

func (d *Driver) GetState() (state.State, error)

GetState returns the state that the host is in (running, stopped, etc)

func (*Driver) GetURL

func (d *Driver) GetURL() (string, error)

GetURL is not implemented yet

func (*Driver) Kill

func (d *Driver) Kill() error

Kill stops a host forcefully

func (*Driver) PreCreateCheck

func (d *Driver) PreCreateCheck() error

PreCreateCheck is called to enforce pre-creation steps

func (*Driver) Remove

func (d *Driver) Remove() error

Remove a host

func (*Driver) Restart

func (d *Driver) Restart() error

Restart a host

func (*Driver) Start

func (d *Driver) Start() error

Start a host

func (*Driver) Stop

func (d *Driver) Stop() error

Stop a host gracefully

func (*Driver) UpdateConfigRaw added in v0.12.8

func (d *Driver) UpdateConfigRaw(rawConfig []byte) error

type InvalidPortNumberError

type InvalidPortNumberError string

InvalidPortNumberError implements the Error interface. It is used when a VSockPorts port number cannot be recognised as an integer.

func (InvalidPortNumberError) Error

func (port InvalidPortNumberError) Error() string

Error returns an Error for InvalidPortNumberError

type MultiError

type MultiError struct {
	Errors []error
}

MultiError holds multiple errors

func (*MultiError) Collect

func (m *MultiError) Collect(err error)

Collect adds the error

func (MultiError) ToError

func (m MultiError) ToError() error

ToError converts all errors into one

type QcowDisk added in v0.12.12

type QcowDisk struct {
	hyperkit.QcowDisk
}

dummy data type used to hack hyperkit.QcowDisk behaviour

func (*QcowDisk) Ensure added in v0.12.12

func (qcow *QcowDisk) Ensure() error

Implementing this method from the hyperkit.Disk interface disables disk * resizing for now as this requires the qcow-tool binary

type RetriableError

type RetriableError struct {
	Err error
}

RetriableError is an error that can be tried again

func (RetriableError) Error

func (r RetriableError) Error() string

Jump to

Keyboard shortcuts

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