hyperkit

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

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

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 struct {
	*drivers.BaseDriver
	*pkgdrivers.CommonDriver
	BootInitrd     string
	BootKernel     string
	Boot2DockerURL string
	DiskSize       int
	CPU            int
	Memory         int
	Cmdline        string
	NFSShares      []string
	NFSSharesRoot  string
	NFSFlags       string
	UUID           string
	VpnKitSock     string
	VSockPorts     []string
}

Driver is the machine driver for Hyperkit

func NewDriver

func NewDriver(machineName, storePath string) *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) GetCreateFlags

func (d *Driver) GetCreateFlags() []mcnflag.Flag

GetCreateFlags registers the flags this driver adds to "docker hosts create"

func (*Driver) GetSSHHostname

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

GetSSHHostname returns hostname for use with ssh

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 returns a Docker compatible host URL for connecting to this host e.g. tcp://1.2.3.4:2376

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) SetConfigFromFlags

func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error

SetConfigFromFlags sets the machine config

func (*Driver) Start

func (d *Driver) Start() error

Start a host

func (*Driver) Stop

func (d *Driver) Stop() error

Stop a host gracefully

type ISOBootFiles

type ISOBootFiles struct {
	InitrdPath      string
	KernelPath      string
	IsoLinuxCfgPath string
}

func ISOExtractBootFiles

func ISOExtractBootFiles(isoPath, destDirPath string) (ISOBootFiles, 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

Jump to

Keyboard shortcuts

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