forked from kata-containers/kata-containers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
factory.go
30 lines (22 loc) · 767 Bytes
/
factory.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (c) 2018 HyperHQ Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
package virtcontainers
import (
"context"
pb "github.com/kata-containers/kata-containers/src/runtime/protocols/cache"
)
// Factory controls how a new VM is created.
type Factory interface {
// Config returns base factory config.
Config() VMConfig
// GetVMStatus returns the status of the paused VM created by the base factory.
GetVMStatus() []*pb.GrpcVMStatus
// GetVM gets a new VM from the factory.
GetVM(ctx context.Context, config VMConfig) (*VM, error)
// GetBaseVM returns a paused VM created by the base factory.
GetBaseVM(ctx context.Context, config VMConfig) (*VM, error)
// CloseFactory closes and cleans up the factory.
CloseFactory(ctx context.Context)
}