parallels

package
v0.117.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDHCPLeasesFile = "/Library/Preferences/Parallels/parallels_dhcp_leases"

Variables

View Source
var (
	ErrParallelsCommandNotFound = errors.New("Parallels command not found")
	ErrParallelsCommandNonZero  = errors.New("Parallels command returned non-zero exit code")
)
View Source
var ErrDHCPSnoopFailed = errors.New("failed to retrieve VM's DHCP address")
View Source
var (
	ErrFailed = errors.New("Parallels isolation failed")
)
View Source
var ErrVMFailed = errors.New("Parallels VM operation failed")
View Source
var ErrVMKiller = errors.New("failed to kill running VM processes")

Functions

func CopyDir

func CopyDir(sourceDir string, destinationDir string) error

func Prlctl

func Prlctl(ctx context.Context, args ...string) (string, string, error)

func Prlsrvctl

func Prlsrvctl(ctx context.Context, args ...string) (string, string, error)

Types

type DHCPLease

type DHCPLease struct {
	MAC   []byte
	IP    string
	Start int64
}

type DHCPSnooper

type DHCPSnooper struct {
	DHCPLeasesFile string
}

func (*DHCPSnooper) FindNewestLease

func (snooper *DHCPSnooper) FindNewestLease(mac []byte) (*DHCPLease, error)

func (*DHCPSnooper) Leases

func (snooper *DHCPSnooper) Leases() ([]*DHCPLease, error)

type HardwareInfo

type HardwareInfo struct {
	Net0 NetworkAdapterInfo
}

type NetworkAdapterInfo

type NetworkAdapterInfo struct {
	MAC string
}

type Option added in v0.35.0

type Option func(parallels *Parallels)

func WithLogger added in v0.35.0

func WithLogger(logger logger.Lightweight) Option

type Parallels

type Parallels struct {
	// contains filtered or unexported fields
}

func New

func New(vmImage, sshUser, sshPassword, agentOS string, opts ...Option) (*Parallels, error)

func (*Parallels) Attributes added in v0.114.2

func (parallels *Parallels) Attributes() []attribute.KeyValue

func (*Parallels) Close added in v0.45.0

func (parallels *Parallels) Close(context.Context) error

func (*Parallels) Run

func (parallels *Parallels) Run(ctx context.Context, config *runconfig.RunConfig) (err error)

func (*Parallels) WorkingDirectory

func (parallels *Parallels) WorkingDirectory(projectDir string, dirtyMode bool) string

type ServerInfo

type ServerInfo struct {
	VMHome string `json:"VM home"`
}

func GetServerInfo

func GetServerInfo(ctx context.Context) (*ServerInfo, error)

type VM

type VM struct {
	// contains filtered or unexported fields
}

func NewVMClonedFrom

func NewVMClonedFrom(ctx context.Context, vmNameFrom string) (*VM, error)

func (*VM) ClonedFromSuspended added in v0.35.0

func (vm *VM) ClonedFromSuspended() bool

func (*VM) Close

func (vm *VM) Close() error

func (*VM) Ident

func (vm *VM) Ident() string

Returns an identifier suitable for use in Parallels CLI commands.

func (*VM) RetrieveIP

func (vm *VM) RetrieveIP(ctx context.Context) (string, error)

func (*VM) Start added in v0.32.2

func (vm *VM) Start(ctx context.Context) error

type VirtualMachineInfo

type VirtualMachineInfo struct {
	ID       string
	Name     string
	State    string
	Home     string
	Hardware HardwareInfo
}

Jump to

Keyboard shortcuts

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