driver

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: Apache-2.0 Imports: 4 Imported by: 2 modules, 8 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseDriver

type BaseDriver struct {
	Instance *store.Instance
	Yaml     *limayaml.LimaYAML

	SSHLocalPort int
}

func (*BaseDriver) ApplySnapshot added in v0.16.0

func (d *BaseDriver) ApplySnapshot(_ context.Context, _ string) error

func (*BaseDriver) CanRunGUI added in v0.17.0

func (d *BaseDriver) CanRunGUI() bool

func (*BaseDriver) ChangeDisplayPassword added in v0.15.0

func (d *BaseDriver) ChangeDisplayPassword(_ context.Context, _ string) error

func (*BaseDriver) CreateDisk

func (d *BaseDriver) CreateDisk() error

func (*BaseDriver) CreateSnapshot added in v0.16.0

func (d *BaseDriver) CreateSnapshot(_ context.Context, _ string) error

func (*BaseDriver) DeleteSnapshot added in v0.16.0

func (d *BaseDriver) DeleteSnapshot(_ context.Context, _ string) error

func (*BaseDriver) GetDisplayConnection added in v0.15.0

func (d *BaseDriver) GetDisplayConnection(_ context.Context) (string, error)

func (*BaseDriver) ListSnapshots added in v0.16.0

func (d *BaseDriver) ListSnapshots(_ context.Context) (string, error)

func (*BaseDriver) RunGUI added in v0.17.0

func (d *BaseDriver) RunGUI() error

func (*BaseDriver) Start

func (d *BaseDriver) Start(_ context.Context) (chan error, error)

func (*BaseDriver) Stop

func (d *BaseDriver) Stop(_ context.Context) error

func (*BaseDriver) Validate

func (d *BaseDriver) Validate() error

type Driver

type Driver interface {
	// Validate returns error if the current driver isn't support for given config
	Validate() error

	// CreateDisk returns error if the current driver fails in creating disk
	CreateDisk() error

	// Start is used for booting the vm using driver instance
	// It returns a chan error on successful boot
	// The second argument may contain error occurred while starting driver
	Start(_ context.Context) (chan error, error)

	// CanRunGUI returns bool to indicate if the hostagent need to run GUI synchronously
	CanRunGUI() bool

	// RunGUI is for starting GUI synchronously by hostagent. This method should be wait and return only after vm terminates
	// It returns error if there are any failures
	RunGUI() error

	// Stop will terminate the running vm instance.
	// It returns error if there are any errors during Stop
	Stop(_ context.Context) error

	ChangeDisplayPassword(_ context.Context, password string) error

	GetDisplayConnection(_ context.Context) (string, error)

	CreateSnapshot(_ context.Context, tag string) error

	ApplySnapshot(_ context.Context, tag string) error

	DeleteSnapshot(_ context.Context, tag string) error

	ListSnapshots(_ context.Context) (string, error)
}

Driver interface is used by hostagent for managing vm.

This interface is extended by BaseDriver which provides default implementation. All other driver definition must extend BaseDriver

Jump to

Keyboard shortcuts

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