Documentation
¶
Index ¶
- type Client
- func (c *Client) AttachSession(ctx context.Context, sandboxID, sessionID string, options SessionAttachOptions) (*SessionAttachHandle, error)
- func (c *Client) Create(ctx context.Context, opts sdktypes.CreateSandboxOptions) (*Sandbox, error)
- func (c *Client) CreateSession(ctx context.Context, sandboxID string, opts sdktypes.CreateSessionOptions) (sdktypes.Session, error)
- func (c *Client) DeleteSession(ctx context.Context, sandboxID, sessionID string) error
- func (c *Client) Destroy(ctx context.Context, id string) error
- func (c *Client) ExecStream(ctx context.Context, id string, options sdktypes.ExecStreamOptions) (*ExecStreamHandle, error)
- func (c *Client) Get(ctx context.Context, id string) (*Sandbox, error)
- func (c *Client) GetSession(ctx context.Context, sandboxID, sessionID string) (sdktypes.Session, error)
- func (c *Client) Health(ctx context.Context) (sdktypes.HealthStatus, error)
- func (c *Client) List(ctx context.Context) ([]*Sandbox, error)
- func (c *Client) ListSessions(ctx context.Context, sandboxID string) ([]sdktypes.Session, error)
- func (c *Client) Mounts(ctx context.Context, id string) ([]sdktypes.MountSpecRedacted, error)
- func (c *Client) Reconcile(ctx context.Context) error
- func (c *Client) Resize(ctx context.Context, id string, opts sdktypes.ResizeSandboxOptions) (*Sandbox, error)
- func (c *Client) ResizeSession(ctx context.Context, sandboxID, sessionID string, cols, rows int) error
- func (c *Client) SessionLog(ctx context.Context, sandboxID, sessionID string) ([]byte, error)
- func (c *Client) SessionRecording(ctx context.Context, sandboxID, sessionID string) ([]byte, error)
- func (c *Client) SignalSession(ctx context.Context, sandboxID, sessionID, signal string) error
- func (c *Client) Start(ctx context.Context, id string) (*Sandbox, error)
- func (c *Client) Stop(ctx context.Context, id string) (*Sandbox, error)
- func (c *Client) UpdateLifecycle(ctx context.Context, id string, lifecycle sdktypes.Lifecycle) (*Sandbox, error)
- type ExecStreamHandle
- func (h *ExecStreamHandle) Close() error
- func (h *ExecStreamHandle) Resize(cols, rows int) error
- func (h *ExecStreamHandle) Signal(name string) error
- func (h *ExecStreamHandle) Wait() (sdktypes.ExecExitInfo, error)
- func (h *ExecStreamHandle) Write(data []byte) error
- func (h *ExecStreamHandle) WriteString(data string) error
- type Sandbox
- func (s *Sandbox) AttachSession(ctx context.Context, sessionID string, options SessionAttachOptions) (*SessionAttachHandle, error)
- func (s *Sandbox) CreateSession(ctx context.Context, opts sdktypes.CreateSessionOptions) (sdktypes.Session, error)
- func (s *Sandbox) DeleteSession(ctx context.Context, sessionID string) error
- func (s *Sandbox) Destroy(ctx context.Context) error
- func (s *Sandbox) DownloadFile(ctx context.Context, targetPath string) ([]byte, error)
- func (s *Sandbox) Exec(ctx context.Context, request sdktypes.ExecRequest) (sdktypes.ExecResult, error)
- func (s *Sandbox) ExecCommand(ctx context.Context, command string) (sdktypes.ExecResult, error)
- func (s *Sandbox) ExecStream(ctx context.Context, options sdktypes.ExecStreamOptions) (*ExecStreamHandle, error)
- func (s *Sandbox) ExposePort(ctx context.Context, port int) (string, error)
- func (s *Sandbox) GetSession(ctx context.Context, sessionID string) (sdktypes.Session, error)
- func (s *Sandbox) ListSessions(ctx context.Context) ([]sdktypes.Session, error)
- func (s *Sandbox) Refresh(ctx context.Context) error
- func (s *Sandbox) Resize(ctx context.Context, opts sdktypes.ResizeSandboxOptions) error
- func (s *Sandbox) ResizeSession(ctx context.Context, sessionID string, cols, rows int) error
- func (s *Sandbox) SessionLog(ctx context.Context, sessionID string) ([]byte, error)
- func (s *Sandbox) SessionRecording(ctx context.Context, sessionID string) ([]byte, error)
- func (s *Sandbox) SignalSession(ctx context.Context, sessionID, signal string) error
- func (s *Sandbox) Start(ctx context.Context) error
- func (s *Sandbox) Stop(ctx context.Context) error
- func (s *Sandbox) UnexposePort(ctx context.Context, port int) error
- func (s *Sandbox) UpdateLifecycle(ctx context.Context, lifecycle sdktypes.Lifecycle) error
- func (s *Sandbox) UploadFile(ctx context.Context, targetPath string, data []byte) error
- type SessionAttachHandle
- func (h *SessionAttachHandle) Close() error
- func (h *SessionAttachHandle) Resize(cols, rows int) error
- func (h *SessionAttachHandle) Signal(name string) error
- func (h *SessionAttachHandle) Wait() (int, string, error)
- func (h *SessionAttachHandle) Write(data []byte) error
- func (h *SessionAttachHandle) WriteString(data string) error
- type SessionAttachOptions
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 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) CreateSession ¶
func (*Client) DeleteSession ¶
func (*Client) ExecStream ¶
func (c *Client) ExecStream(ctx context.Context, id string, options sdktypes.ExecStreamOptions) (*ExecStreamHandle, error)
func (*Client) GetSession ¶
func (*Client) ListSessions ¶
func (*Client) Mounts ¶
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) ResizeSession ¶
func (*Client) SessionLog ¶
func (*Client) SessionRecording ¶
func (*Client) SignalSession ¶
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 (h *ExecStreamHandle) Wait() (sdktypes.ExecExitInfo, error)
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 (*Sandbox) DeleteSession ¶
func (*Sandbox) DownloadFile ¶
func (*Sandbox) Exec ¶
func (s *Sandbox) Exec(ctx context.Context, request sdktypes.ExecRequest) (sdktypes.ExecResult, error)
func (*Sandbox) ExecCommand ¶
func (*Sandbox) ExecStream ¶
func (s *Sandbox) ExecStream(ctx context.Context, options sdktypes.ExecStreamOptions) (*ExecStreamHandle, error)
func (*Sandbox) ExposePort ¶
func (*Sandbox) GetSession ¶
func (*Sandbox) ListSessions ¶
func (*Sandbox) ResizeSession ¶
func (*Sandbox) SessionLog ¶
func (*Sandbox) SessionRecording ¶
func (*Sandbox) SignalSession ¶
func (*Sandbox) UpdateLifecycle ¶
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) 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.