Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
The Engine keeps everything running.
All spawned processes are monitored by the WaitGroup. We also increment the WaitGroup counter when creating the Engine itself, so it won't terminate before receiving CreateGroup requests. The call to Stop() then decrements the initial WaitGroup counter, allowing us to wait for all the processing threads to stop cleanly.
func NewEngine ¶
func NewEngine(registry vmine.ImageRegistry, memoryLimit int) *Engine
NewEngine creates a new Engine.
func (*Engine) CreateGroup ¶
CreateGroup creates and starts a new vm group.
func (*Engine) StopGroup ¶
func (e *Engine) StopGroup(req *vmine.StopGroupRequest) error
StopGroup terminates a running vm group. The method waits for resource teardown.
type HTTPEngine ¶
type HTTPEngine struct {
*Engine
}
HTTPEngine wraps an Engine with an HTTP API. It implements the http.Handler interface.
func NewHTTPEngine ¶
func NewHTTPEngine(e *Engine) *HTTPEngine
func (*HTTPEngine) ServeHTTP ¶
func (h *HTTPEngine) ServeHTTP(w http.ResponseWriter, r *http.Request)
type NetworkProvider ¶
type NetworkProvider interface {
Build(Transaction, *vmine.Network) error
}
type RunnableTask ¶
RunnableTask is an interface to a task that can be run, waiting until its termination.
type SetupTask ¶
SetupTask interface, with separate setup / teardown steps.
type Transaction ¶
type Transaction interface {
Setup(SetupTask)
Run(RunnableTask)
// There's no rollback, as nothing happens until you call
// Execute() anyway, and it takes care of undoing all the
// steps that were performed up to the failure.
Execute(context.Context) error
}
The Transaction is the abstraction we use to collect and execute setup / teardown tasks and running processes. Calls to Setup() and Run() just gather information, which is only applied on Execute().
Source Files
¶
- engine.go
- group.go
- http.go
- instrumentation.go
- metric_allocator.go
- qemu.go
- tx.go
- util.go