firecracker

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package firecracker implements a Firecracker-based Provider. It supports a remote HTTP host-agent client and a stub in-memory fallback for dev/tests so Fleet/Boot can remain provider-agnostic.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BaseURL     string       // host agent base URL, e.g. https://agent.local
	Token       string       // bearer token for auth
	HTTPClient  *http.Client // optional; defaults to http.DefaultClient
	UseStub     bool         // force in-memory stub (for dev/tests)
	DownloadURL string       // optional URL to fetch the guest agent binary (forwarded to /start-agent)
}

Config configures the Firecracker provider client.

type Provider

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

Provider implements orchestrator.Provider backed by a Firecracker host agent API. If UseStub is true or BaseURL is empty, it falls back to an in-memory stub that simulates behavior without real microVMs.

func New

func New(cfg Config) *Provider

New creates a Firecracker provider.

TODO: Default to a custom http.Client with a 30s timeout instead of http.DefaultClient (which has no timeout). Long-running calls like Create should use per-request context deadlines, but a client-level timeout prevents leaked connections on unresponsive hosts.

func (*Provider) Close

func (p *Provider) Close() error

Close releases resources.

func (*Provider) Create

Create provisions a new sandbox.

func (*Provider) Destroy

func (p *Provider) Destroy(ctx context.Context, name string) error

Destroy tears down a sandbox.

func (*Provider) Get

Get returns an existing sandbox.

func (*Provider) List

func (p *Provider) List(ctx context.Context, prefix string) ([]orchestrator.Environment, error)

List returns all sandboxes matching the given prefix.

Jump to

Keyboard shortcuts

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