microvm

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient() (*Client, error)

func NewClientWithConfig

func NewClientWithConfig(config *sdktypes.MicroVMConfig) (*Client, error)

func (*Client) AttachSession

func (c *Client) AttachSession(ctx context.Context, sandboxID, sessionID string, options SessionAttachOptions) (*SessionAttachHandle, error)

func (*Client) Create

func (c *Client) Create(ctx context.Context, opts sdktypes.CreateSandboxOptions) (*Sandbox, error)

func (*Client) CreateSession

func (c *Client) CreateSession(ctx context.Context, sandboxID string, opts sdktypes.CreateSessionOptions) (sdktypes.Session, error)

func (*Client) DeleteSession

func (c *Client) DeleteSession(ctx context.Context, sandboxID, sessionID string) error

func (*Client) Destroy

func (c *Client) Destroy(ctx context.Context, id string) error

func (*Client) ExecStream

func (c *Client) ExecStream(ctx context.Context, id string, options sdktypes.ExecStreamOptions) (*ExecStreamHandle, error)

func (*Client) Get

func (c *Client) Get(ctx context.Context, id string) (*Sandbox, error)

func (*Client) GetSession

func (c *Client) GetSession(ctx context.Context, sandboxID, sessionID string) (sdktypes.Session, error)

func (*Client) Health

func (c *Client) Health(ctx context.Context) (sdktypes.HealthStatus, error)

func (*Client) List

func (c *Client) List(ctx context.Context) ([]*Sandbox, error)

func (*Client) ListSessions

func (c *Client) ListSessions(ctx context.Context, sandboxID string) ([]sdktypes.Session, error)

func (*Client) Mounts

func (c *Client) Mounts(ctx context.Context, id string) ([]sdktypes.MountSpecRedacted, error)

Mounts returns the redacted mount config for a sandbox. Credentials are never included; this endpoint is for showing the user what their sandbox has configured, not for retrieving secrets.

func (*Client) Reconcile added in v0.1.1

func (c *Client) Reconcile(ctx context.Context) error

func (*Client) Resize

func (c *Client) Resize(ctx context.Context, id string, opts sdktypes.ResizeSandboxOptions) (*Sandbox, error)

func (*Client) ResizeSession

func (c *Client) ResizeSession(ctx context.Context, sandboxID, sessionID string, cols, rows int) error

func (*Client) SessionLog

func (c *Client) SessionLog(ctx context.Context, sandboxID, sessionID string) ([]byte, error)

func (*Client) SessionRecording

func (c *Client) SessionRecording(ctx context.Context, sandboxID, sessionID string) ([]byte, error)

func (*Client) SignalSession

func (c *Client) SignalSession(ctx context.Context, sandboxID, sessionID, signal string) error

func (*Client) Start

func (c *Client) Start(ctx context.Context, id string) (*Sandbox, error)

func (*Client) Stop

func (c *Client) Stop(ctx context.Context, id string) (*Sandbox, error)

func (*Client) UpdateLifecycle

func (c *Client) UpdateLifecycle(ctx context.Context, id string, lifecycle sdktypes.Lifecycle) (*Sandbox, error)

UpdateLifecycle replaces the per-sandbox lifecycle timers. Pass zero in any field to clear that timer; pass non-zero to set or extend it. The server validates and rejects negative durations, durations over the configured cap, or stop/destroy pairs where destroy fires before stop.

type ExecStreamHandle

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

func (*ExecStreamHandle) Close

func (h *ExecStreamHandle) Close() error

func (*ExecStreamHandle) Resize

func (h *ExecStreamHandle) Resize(cols, rows int) error

func (*ExecStreamHandle) Signal

func (h *ExecStreamHandle) Signal(name string) error

func (*ExecStreamHandle) Wait

func (*ExecStreamHandle) Write

func (h *ExecStreamHandle) Write(data []byte) error

func (*ExecStreamHandle) WriteString

func (h *ExecStreamHandle) WriteString(data string) error

type Sandbox

type Sandbox struct {
	sdktypes.Sandbox
	// SSHPrivateKey is populated only on the response from Client.Create. It
	// is the per-sandbox ed25519 private key the gateway authorizes; persist
	// it locally before discarding the create response, the server cannot
	// regenerate it.
	SSHPrivateKey string
	// contains filtered or unexported fields
}

func (*Sandbox) AttachSession

func (s *Sandbox) AttachSession(ctx context.Context, sessionID string, options SessionAttachOptions) (*SessionAttachHandle, error)

func (*Sandbox) CreateSession

func (s *Sandbox) CreateSession(ctx context.Context, opts sdktypes.CreateSessionOptions) (sdktypes.Session, error)

func (*Sandbox) DeleteSession

func (s *Sandbox) DeleteSession(ctx context.Context, sessionID string) error

func (*Sandbox) Destroy

func (s *Sandbox) Destroy(ctx context.Context) error

func (*Sandbox) DownloadFile

func (s *Sandbox) DownloadFile(ctx context.Context, targetPath string) ([]byte, error)

func (*Sandbox) Exec

func (*Sandbox) ExecCommand

func (s *Sandbox) ExecCommand(ctx context.Context, command string) (sdktypes.ExecResult, error)

func (*Sandbox) ExecStream

func (s *Sandbox) ExecStream(ctx context.Context, options sdktypes.ExecStreamOptions) (*ExecStreamHandle, error)

func (*Sandbox) ExposePort

func (s *Sandbox) ExposePort(ctx context.Context, port int) (string, error)

func (*Sandbox) GetSession

func (s *Sandbox) GetSession(ctx context.Context, sessionID string) (sdktypes.Session, error)

func (*Sandbox) ListSessions

func (s *Sandbox) ListSessions(ctx context.Context) ([]sdktypes.Session, error)

func (*Sandbox) Refresh

func (s *Sandbox) Refresh(ctx context.Context) error

func (*Sandbox) Resize

func (*Sandbox) ResizeSession

func (s *Sandbox) ResizeSession(ctx context.Context, sessionID string, cols, rows int) error

func (*Sandbox) SessionLog

func (s *Sandbox) SessionLog(ctx context.Context, sessionID string) ([]byte, error)

func (*Sandbox) SessionRecording

func (s *Sandbox) SessionRecording(ctx context.Context, sessionID string) ([]byte, error)

func (*Sandbox) SignalSession

func (s *Sandbox) SignalSession(ctx context.Context, sessionID, signal string) error

func (*Sandbox) Start

func (s *Sandbox) Start(ctx context.Context) error

func (*Sandbox) Stop

func (s *Sandbox) Stop(ctx context.Context) error

func (*Sandbox) UnexposePort

func (s *Sandbox) UnexposePort(ctx context.Context, port int) error

func (*Sandbox) UpdateLifecycle

func (s *Sandbox) UpdateLifecycle(ctx context.Context, lifecycle sdktypes.Lifecycle) error

func (*Sandbox) UploadFile

func (s *Sandbox) UploadFile(ctx context.Context, targetPath string, data []byte) error

type SessionAttachHandle

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

SessionAttachHandle is the live-session counterpart of ExecStreamHandle. It outlives the underlying process — Close() detaches without killing.

func (*SessionAttachHandle) Close

func (h *SessionAttachHandle) Close() error

func (*SessionAttachHandle) Resize

func (h *SessionAttachHandle) Resize(cols, rows int) error

func (*SessionAttachHandle) Signal

func (h *SessionAttachHandle) Signal(name string) error

func (*SessionAttachHandle) Wait

func (h *SessionAttachHandle) Wait() (int, string, error)

func (*SessionAttachHandle) Write

func (h *SessionAttachHandle) Write(data []byte) error

func (*SessionAttachHandle) WriteString

func (h *SessionAttachHandle) WriteString(data string) error

type SessionAttachOptions

type SessionAttachOptions = apiclient.SessionAttachOptions

SessionAttachOptions mirrors apiclient.SessionAttachOptions; re-exported here so callers don't need to import the internal package.

Jump to

Keyboard shortcuts

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