Documentation
¶
Index ¶
- Constants
- type BuildImageOptions
- type BuildImagePushOptions
- type BuildImageResult
- type CreateSandboxOptions
- type CreateSessionOptions
- type ExecExitInfo
- type ExecRequest
- type ExecResult
- type ExecStreamOptions
- type ExposeProtocol
- type ExposeResult
- type ExposedPort
- type Failover
- type GPURequest
- type GPUVendor
- type HealthStatus
- type Lifecycle
- type MicroVMConfig
- type MountSpec
- type MountSpecRedacted
- type MountType
- type NetworkUsage
- type RegisterSnapshotOptions
- type ResizeSandboxOptions
- type Sandbox
- type SandboxSnapshot
- type Session
- type SessionStatus
- type SetNetworkLimitsOptions
- type StreamCallback
- type StreamErrorCallback
- type UpdateLifecycleOptions
Constants ¶
const ( FailoverPolicyNone = models.FailoverPolicyNone FailoverPolicyRecreate = models.FailoverPolicyRecreate )
const ( SessionStatusRunning = models.SessionStatusRunning SessionStatusExited = models.SessionStatusExited SessionStatusKilled = models.SessionStatusKilled SessionStatusFailed = models.SessionStatusFailed )
const ( MountTypeS3 = models.MountTypeS3 MountTypeNFS = models.MountTypeNFS MountTypeSSHFS = models.MountTypeSSHFS MountTypeRclone = models.MountTypeRclone )
const ( RuntimeDocker = models.RuntimeDocker RuntimeGvisor = models.RuntimeGvisor RuntimeKata = models.RuntimeKata )
const ( GPUVendorNVIDIA = models.GPUVendorNVIDIA GPUVendorAMD = models.GPUVendorAMD GPUVendorApple = models.GPUVendorApple )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildImageOptions ¶ added in v0.1.7
type BuildImageOptions struct {
Push *BuildImagePushOptions
}
BuildImageOptions are optional knobs for Client.BuildImageWithOptions.
type BuildImagePushOptions ¶ added in v0.1.7
type BuildImagePushOptions struct {
// Registry is the destination repository, e.g. "ghcr.io/my-org/my-image".
Registry string
// Tag is the destination tag. The daemon defaults to "latest" when empty.
Tag string
// Server is the registry serveraddress, e.g. "ghcr.io". Sent inside
// X-Registry-Auth.
Server string
Username string
Password string
}
BuildImagePushOptions describes the per-request push directive for Client.BuildImageWithOptions. Credentials are forwarded to the daemon as a one-shot X-Registry-Auth header on the push call and are never persisted.
type BuildImageResult ¶ added in v0.1.7
type BuildImageResult struct {
// Image is the local content-addressed tag (always returned).
Image string
// Pushed is the pushed reference (e.g. "ghcr.io/x/y:v1") when push was
// requested, otherwise empty.
Pushed string
}
BuildImageResult is the response from Client.BuildImageWithOptions.
type CreateSandboxOptions ¶
type CreateSandboxOptions = models.CreateSandboxRequest
type CreateSessionOptions ¶
type CreateSessionOptions = models.CreateSessionRequest
type ExecExitInfo ¶
type ExecRequest ¶
type ExecRequest = models.ExecRequest
type ExecResult ¶
type ExecResult = models.ExecResult
type ExecStreamOptions ¶
type ExecStreamOptions struct {
Command string `json:"command"`
Workdir string `json:"workdir,omitempty"`
Env map[string]string `json:"env,omitempty"`
TTY bool `json:"tty,omitempty"`
Cols int `json:"cols,omitempty"`
Rows int `json:"rows,omitempty"`
OnStdout StreamCallback `json:"-"`
OnStderr StreamCallback `json:"-"`
OnError StreamErrorCallback `json:"-"`
}
type ExposeProtocol ¶ added in v0.1.6
type ExposeProtocol string
ExposeProtocol selects the wire surface an exposure publishes through.
const ( // ExposeProtocolHTTP is the default — Caddy HTTP reverse proxy at // https://<id>-<port>.<domain> (or the path-mode equivalent on an // IP-only deployment). ExposeProtocolHTTP ExposeProtocol = "http" // ExposeProtocolTCP allocates a parent-host port from the configured // pool and forwards raw bytes to the container via caddy-l4. ExposeProtocolTCP ExposeProtocol = "tcp" // ExposeProtocolTLS adds a TLS-SNI route to the shared layer4 server. // Requires the daemon to have a domain configured AND // SB_L4_TLS_LISTEN set. ExposeProtocolTLS ExposeProtocol = "tls" )
type ExposeResult ¶ added in v0.1.6
type ExposeResult = models.ExposePortResponse
ExposeResult is the structured outcome of a successful expose call. Host and HostPort are populated only when Protocol == ExposeProtocolTCP — for HTTP and TLS exposures the dialable URL is in URL alone.
type ExposedPort ¶
type ExposedPort = models.ExposedPort
type GPURequest ¶ added in v0.1.3
type GPURequest = models.GPURequest
type HealthStatus ¶
type HealthStatus = models.HealthStatus
type MicroVMConfig ¶
type MicroVMConfig struct {
PATToken string
APIUrl string
HTTPClient *http.Client
// APIVersion pins which wire version of the sandbox daemon API the
// client speaks. Empty defaults to the SDK's pinned default ("v1"
// today). The Go SDK's package version and the wire version evolve
// independently — bumping the SDK doesn't move the wire version.
APIVersion string
}
type MountSpecRedacted ¶
type MountSpecRedacted = models.MountSpecRedacted
type NetworkUsage ¶ added in v0.1.7
type NetworkUsage = models.NetworkUsage
type RegisterSnapshotOptions ¶ added in v0.1.7
type RegisterSnapshotOptions struct {
// Name is the human-readable identifier other callers use to reference
// this snapshot in CreateSandboxOptions.Snapshot. Required.
Name string
// Image is a pre-built registry image reference (e.g. "python:3.12").
// Mutually exclusive with DockerfileContent.
Image string
// DockerfileContent is the literal Dockerfile the daemon will build.
// Mutually exclusive with Image. Use Image.Dockerfile() to obtain this
// from an Image-builder graph, or RegisterSnapshotFromImage to skip the
// indirection entirely.
DockerfileContent string
// ContextHashes references blobs uploaded ahead of time so COPY/ADD
// steps in DockerfileContent can resolve. Requires the daemon to have
// SB_IMAGE_BUILD_CONTEXT_ENABLED set; the resolver itself is not
// implemented yet, so non-empty values currently return 501.
ContextHashes []string
// Entrypoint overrides the image's entrypoint. Echoed back on the
// snapshot row so future sandbox-create calls inherit it.
Entrypoint []string
// RegionID pins the snapshot to a specific region for multi-region
// deployments. Persisted on the row but not yet used for routing.
RegionID string
// CPU, GPU, MemoryMB, DiskGB are resource hints surfaced to clients.
CPU float64
GPU float64
MemoryMB int
DiskGB int
}
RegisterSnapshotOptions is the input shape for Client.RegisterSnapshot. Exactly one of Image (a pre-built registry reference) or DockerfileContent (build inputs the daemon will compile) must be set.
The remaining fields capture the resource hints the snapshot will report when listed or used in CreateSandboxOptions.Snapshot.
type ResizeSandboxOptions ¶
type ResizeSandboxOptions = models.ResizeSandboxRequest
type SandboxSnapshot ¶ added in v0.1.7
type SandboxSnapshot = models.SandboxSnapshot
type SessionStatus ¶
type SessionStatus = models.SessionStatus
type SetNetworkLimitsOptions ¶ added in v0.1.7
type SetNetworkLimitsOptions = models.UpdateNetworkLimitsRequest
type StreamCallback ¶
type StreamCallback func([]byte)
type StreamErrorCallback ¶
type StreamErrorCallback func(string)
type UpdateLifecycleOptions ¶
type UpdateLifecycleOptions = models.UpdateLifecycleRequest