MCPcopy
hub / github.com/lima-vm/lima / Lifecycle

Interface Lifecycle

pkg/driver/driver.go:20–51  ·  view source on GitHub ↗

Lifecycle defines basic lifecycle operations.

Source from the content-addressed store, hash-verified

18
19// Lifecycle defines basic lifecycle operations.
20type Lifecycle interface {
21 // Validate returns error if the current driver isn't support for given config
22 Validate(_ context.Context) error
23
24 // Create is called on creating the instance for the first time.
25 // (e.g., creating "vz-identifier" file)
26 //
27 // Create MUST return nil when it is called against an existing instance.
28 //
29 // Create does not create the disks.
30 Create(_ context.Context) error
31
32 // CreateDisk returns error if the current driver fails in creating disk
33 CreateDisk(_ context.Context) error
34
35 // Start is used for booting the vm using driver instance
36 // It returns a chan error on successful boot
37 // The second argument may contain error occurred while starting driver
38 Start(_ context.Context) (chan error, error)
39
40 // Stop will terminate the running vm instance.
41 // It returns error if there are any errors during Stop
42 Stop(_ context.Context) error
43
44 Delete(_ context.Context) error
45
46 InspectStatus(_ context.Context, inst *limatype.Instance) string
47
48 // BootScripts returns the content of boot scripts to be injected into the vm.
49 // The key must be "boot.<OS>/<SCRIPT>" or "<SCRIPT>" (deprecated alias for "boot.Linux/<SCRIPT>").
50 BootScripts(ctx context.Context) (map[string][]byte, error)
51}
52
53// GUI defines GUI-related operations.
54type GUI interface {

Callers 36

validateConfigFunction · 0.65
WithExpectedDigestFunction · 0.65
validateFileObjectFunction · 0.65
ValidateFunction · 0.65
PrepareFunction · 0.65
sudoersActionFunction · 0.65
createResolveFileFunction · 0.65
StartFunction · 0.65
writeLeasesFunction · 0.65
startDaemonFunction · 0.65
TestDownloadLocalFunction · 0.65
downloadHTTPFunction · 0.65

Implementers 6

mockDriverpkg/registry/registry_test.go
LimaVzDriverpkg/driver/vz/vz_driver_darwin.go
LimaQemuDriverpkg/driver/qemu/qemu_driver.go
LimaKrunkitDriverpkg/driver/krunkit/krunkit_driver_darw
DriverClientpkg/driver/external/client/client.go
LimaWslDriverpkg/driver/wsl2/wsl_driver_windows.go

Calls

no outgoing calls

Tested by

no test coverage detected