Puck.Sandbox.Runtime.Instance (Puck v0.2.23)

Copy Markdown View Source

Struct representing a runtime sandbox instance.

This is a lightweight handle to an existing sandbox. The actual sandbox state lives in the infrastructure (Docker container, Fly machine, etc.) and should be queried via Puck.Sandbox.Runtime.status/1.

Summary

Functions

Creates a new Instance struct with the given attributes.

Types

t()

@type t() :: %Puck.Sandbox.Runtime.Instance{
  adapter: module(),
  config: map(),
  created_at: integer(),
  id: String.t(),
  metadata: map()
}

Functions

new(attrs \\ [])

Creates a new Instance struct with the given attributes.

Examples

iex> instance = Puck.Sandbox.Runtime.Instance.new(id: "abc123", adapter: Docker)
iex> {instance.id, instance.adapter, instance.config, instance.metadata}
{"abc123", Docker, %{}, %{}}