# types (/docs/go-sdk/types)

{/* Code generated by gomarkdoc. DO NOT EDIT */}
# types [#types]

```go
import "github.com/daytona/clients/sdk-go/pkg/types"
```

## Index [#index]

- [Constants](<#constants>)
- [type Chart](<#Chart>)
- [type CodeLanguage](<#CodeLanguage>)
- [type CodeRunParams](<#CodeRunParams>)
- [type CreateSecretParams](<#CreateSecretParams>)
- [type CreateSnapshotParams](<#CreateSnapshotParams>)
- [type CreateWarmPoolParams](<#CreateWarmPoolParams>)
- [type DaytonaConfig](<#DaytonaConfig>)
- [type ExecuteResponse](<#ExecuteResponse>)
- [type ExecutionArtifacts](<#ExecutionArtifacts>)
- [type ExecutionError](<#ExecutionError>)
- [type ExecutionResult](<#ExecutionResult>)
- [type ExperimentalConfig](<#ExperimentalConfig>)
- [type FileDownloadRequest](<#FileDownloadRequest>)
- [type FileDownloadResponse](<#FileDownloadResponse>)
- [type FileInfo](<#FileInfo>)
- [type FileStatus](<#FileStatus>)
- [type FileUpload](<#FileUpload>)
- [type GitCommitResponse](<#GitCommitResponse>)
- [type GitRemote](<#GitRemote>)
- [type GitStatus](<#GitStatus>)
- [type GpuType](<#GpuType>)
- [type ImageParams](<#ImageParams>)
- [type ListSecretsQuery](<#ListSecretsQuery>)
- [type ListSecretsResponse](<#ListSecretsResponse>)
- [type LspLanguageID](<#LspLanguageID>)
- [type OutputMessage](<#OutputMessage>)
- [type PaginatedSnapshots](<#PaginatedSnapshots>)
- [type Position](<#Position>)
- [type PreviewLink](<#PreviewLink>)
- [type PtyResult](<#PtyResult>)
- [type PtySessionInfo](<#PtySessionInfo>)
- [type PtySize](<#PtySize>)
- [type Resources](<#Resources>)
- [type SandboxBaseParams](<#SandboxBaseParams>)
- [type SandboxClass](<#SandboxClass>)
- [type ScreenshotOptions](<#ScreenshotOptions>)
- [type ScreenshotRegion](<#ScreenshotRegion>)
- [type ScreenshotResponse](<#ScreenshotResponse>)
- [type Secret](<#Secret>)
- [type SignedPreviewLink](<#SignedPreviewLink>)
- [type Snapshot](<#Snapshot>)
- [type SnapshotParams](<#SnapshotParams>)
- [type UpdateSecretParams](<#UpdateSecretParams>)
- [type Volume](<#Volume>)
- [type VolumeMount](<#VolumeMount>)
- [type WarmPool](<#WarmPool>)


## Constants [#constants]

<a name="CodeToolboxLanguageLabel"></a>

```go
const CodeToolboxLanguageLabel = "code-toolbox-language"
```

<a name="Chart"></a>
## type Chart [#type-chart]



```go
type Chart = toolbox.Chart
```

<a name="CodeLanguage"></a>
## type CodeLanguage [#type-codelanguage]

CodeLanguage

```go
type CodeLanguage string
```

<a name="CodeLanguagePython"></a>

```go
const (
    CodeLanguagePython     CodeLanguage = "python"
    CodeLanguageJavaScript CodeLanguage = "javascript"
    CodeLanguageTypeScript CodeLanguage = "typescript"
)
```

<a name="CodeRunParams"></a>
## type CodeRunParams [#type-coderunparams]

CodeRunParams represents parameters for code execution

```go
type CodeRunParams struct {
    Argv []string
    Env  map[string]string
}
```

<a name="CreateSecretParams"></a>
## type CreateSecretParams [#type-createsecretparams]

CreateSecretParams contains parameters for creating a secret.

```go
type CreateSecretParams struct {
    // Name is the secret name. It must match ^[a-zA-Z_][a-zA-Z0-9_-]*$ and be
    // unique within the organization (a duplicate name returns a 409 conflict).
    Name string
    // Value is the plaintext secret value. It is write-only and never returned.
    Value string
    // Description is an optional human-readable description.
    Description *string
    // Hosts are the allowed hosts this secret may be sent to. Entries are exact
    // hostnames or "*." wildcards (without ports).
    Hosts []string
}
```

<a name="CreateSnapshotParams"></a>
## type CreateSnapshotParams [#type-createsnapshotparams]

CreateSnapshotParams represents parameters for creating a snapshot

```go
type CreateSnapshotParams struct {
    Name           string
    Image          any // string or *Image
    Resources      *Resources
    Entrypoint     []string
    SkipValidation *bool
    SandboxClass   *SandboxClass
    // RegionID is the region where the snapshot is created. When nil or empty, the
    // client-level target is used if set; otherwise the organization's default region.
    RegionID *string
}
```

<a name="CreateWarmPoolParams"></a>
## type CreateWarmPoolParams [#type-createwarmpoolparams]

CreateWarmPoolParams contains parameters for creating a warm pool.

```go
type CreateWarmPoolParams struct {
    // Snapshot is the snapshot (ID or name) to keep warm sandboxes for.
    Snapshot string
    // Pool is the number of warm sandboxes to keep ready.
    Pool int
    // Target is the target region for the warm pool. Defaults to the
    // organization default region when nil.
    Target *string
}
```

<a name="DaytonaConfig"></a>
## type DaytonaConfig [#type-daytonaconfig]

DaytonaConfig represents the configuration for the Daytona client. When a field is nil, the client will fall back to environment variables or defaults.

```go
type DaytonaConfig struct {
    APIKey         string
    JWTToken       string
    OrganizationID string
    APIUrl         string
    // Target is the default region for sandboxes and snapshots. When empty, the DAYTONA_TARGET
    // environment variable is used. A per-call [SandboxBaseParams.Target] or
    // [CreateSnapshotParams.RegionID] overrides it; when neither is set, the organization's
    // default region is used.
    Target      string
    OtelEnabled bool // Enable OpenTelemetry tracing for SDK operations.
    // UseDeprecatedPolling observes sandbox state by legacy polling instead of
    // WebSocket event streaming. Defaults to false (event streaming). Can also be
    // enabled via the DAYTONA_USE_DEPRECATED_POLLING environment variable.
    //
    // Deprecated: polling-only mode will be removed in a future release; event
    // streaming is the default and falls back to polling automatically when
    // WebSockets are unavailable.
    UseDeprecatedPolling *bool
    // Timeout overrides the default per-request HTTP timeout (60s). A
    // non-positive value disables the client-wide timeout entirely. Executions
    // with an explicit execution timeout are not capped by this value.
    Timeout *time.Duration
    // HTTPClient supplies a custom *http.Client for API requests. It is copied
    // before use (Transport shared); Timeout, when set, overrides the copy's.
    HTTPClient   *http.Client
    Experimental *ExperimentalConfig
}
```

<a name="ExecuteResponse"></a>
## type ExecuteResponse [#type-executeresponse]

ExecuteResponse represents a command execution response

```go
type ExecuteResponse struct {
    ExitCode  int
    Result    string
    Artifacts *ExecutionArtifacts // nil when no artifacts available
}
```

<a name="ExecutionArtifacts"></a>
## type ExecutionArtifacts [#type-executionartifacts]

ExecutionArtifacts represents execution output artifacts

```go
type ExecutionArtifacts struct {
    Stdout string
    Charts []Chart
}
```

<a name="ExecutionError"></a>
## type ExecutionError [#type-executionerror]

ExecutionError represents a code execution error

```go
type ExecutionError struct {
    Name      string
    Value     string
    Traceback *string // Optional stack trace; nil when not available
    Err       error   `json:"-"` // Underlying client-side cause; nil for server-reported execution errors and execution timeouts.
}
```

<a name="ExecutionResult"></a>
## type ExecutionResult [#type-executionresult]

ExecutionResult represents code interpreter execution result

```go
type ExecutionResult struct {
    Stdout string
    Stderr string
    Charts []Chart         // Optional charts from matplotlib
    Error  *ExecutionError // nil = success, non-nil = execution failed
}
```

<a name="ExperimentalConfig"></a>
## type ExperimentalConfig [#type-experimentalconfig]

ExperimentalConfig holds experimental feature flags for the Daytona client.

```go
type ExperimentalConfig struct {
    // Deprecated: use DaytonaConfig.OtelEnabled. Kept for backwards compatibility.
    OtelEnabled bool
}
```

<a name="FileDownloadRequest"></a>
## type FileDownloadRequest [#type-filedownloadrequest]

FileDownloadRequest

```go
type FileDownloadRequest struct {
    Source      string
    Destination *string // nil = download to memory (return []byte), non-nil = save to file path
}
```

<a name="FileDownloadResponse"></a>
## type FileDownloadResponse [#type-filedownloadresponse]

FileDownloadResponse represents a file download response

```go
type FileDownloadResponse struct {
    Source string
    Result any     // []byte or string (path)
    Error  *string // nil = success, non-nil = error message
}
```

<a name="FileInfo"></a>
## type FileInfo [#type-fileinfo]

FileInfo represents file metadata

```go
type FileInfo struct {
    Name         string
    Path         string
    Size         int64
    Mode         string
    ModifiedTime time.Time
    IsDirectory  bool
}
```

<a name="FileStatus"></a>
## type FileStatus [#type-filestatus]

FileStatus represents the status of a file in git

```go
type FileStatus struct {
    Path   string
    Status string
}
```

<a name="FileUpload"></a>
## type FileUpload [#type-fileupload]

FileUpload represents a file to upload

```go
type FileUpload struct {
    Source      any // []byte or string (path)
    Destination string
}
```

<a name="GitCommitResponse"></a>
## type GitCommitResponse [#type-gitcommitresponse]

GitCommitResponse

```go
type GitCommitResponse struct {
    SHA string
}
```

<a name="GitRemote"></a>
## type GitRemote [#type-gitremote]

GitRemote describes a configured Git remote.

```go
type GitRemote struct {
    Name string
    URL  string
}
```

<a name="GitStatus"></a>
## type GitStatus [#type-gitstatus]

GitStatus represents git repository status

```go
type GitStatus struct {
    CurrentBranch   string
    Ahead           int
    Behind          int
    BranchPublished bool
    FileStatus      []FileStatus
    // Detached is true when HEAD is not on a branch (detached HEAD state).
    Detached bool
    // Upstream is the upstream tracking branch (e.g. "origin/main"), empty when unset.
    Upstream string
}
```

<a name="GpuType"></a>
## type GpuType [#type-gputype]

GpuType identifies a specific GPU model. Used in [Resources.GpuType](<#Resources>) as an ordered preference list — the scheduler tries each in order and pins the sandbox/snapshot to the first that has capacity. It is an alias for the API client's GpuType type.

```go
type GpuType = apiclient.GpuType
```

<a name="GpuTypeH100"></a>

```go
const (
    GpuTypeH100       GpuType = apiclient.GPUTYPE_H100
    GpuTypeB200       GpuType = apiclient.GPUTYPE_B200
    GpuTypeB300       GpuType = apiclient.GPUTYPE_B300
    GpuTypeRtxPro6000 GpuType = apiclient.GPUTYPE_RTX_PRO_6000
    GpuTypeMI355X     GpuType = apiclient.GPUTYPE_MI355X
)
```

<a name="ImageParams"></a>
## type ImageParams [#type-imageparams]

ImageParams represents parameters for creating a sandbox from an image

```go
type ImageParams struct {
    SandboxBaseParams
    Image     any // string or *Image
    Resources *Resources
}
```

<a name="ListSecretsQuery"></a>
## type ListSecretsQuery [#type-listsecretsquery]

ListSecretsQuery contains query parameters for filtering, sorting, and paginating when listing secrets. All fields are optional.

```go
type ListSecretsQuery struct {
    // Pagination cursor from a previous response's NextCursor
    Cursor *string
    // Number of results per page (1-200, default 100)
    Limit *int
    // Filter by partial name match
    Name *string
    // Sort by field: "name", "createdAt", or "updatedAt" (default "createdAt")
    Sort *string
    // Sort direction: "asc" or "desc" (default "desc")
    Order *string
}
```

<a name="ListSecretsResponse"></a>
## type ListSecretsResponse [#type-listsecretsresponse]

ListSecretsResponse represents a paginated list of secrets

```go
type ListSecretsResponse struct {
    Items []*Secret
    // Total number of secrets matching the filters
    Total int
    // Cursor for the next page of results; nil when there are no further pages
    NextCursor *string
}
```

<a name="LspLanguageID"></a>
## type LspLanguageID [#type-lsplanguageid]



```go
type LspLanguageID string
```

<a name="LspLanguagePython"></a>

```go
const (
    LspLanguagePython     LspLanguageID = "python"
    LspLanguageJavaScript LspLanguageID = "javascript"
    LspLanguageTypeScript LspLanguageID = "typescript"
)
```

<a name="OutputMessage"></a>
## type OutputMessage [#type-outputmessage]

OutputMessage represents an output message

```go
type OutputMessage struct {
    Type      string `json:"type"`
    Text      string `json:"text"`
    Name      string `json:"name"`
    Value     string `json:"value"`
    Traceback string `json:"traceback"`
}
```

<a name="PaginatedSnapshots"></a>
## type PaginatedSnapshots [#type-paginatedsnapshots]

PaginatedSnapshots represents a paginated list of snapshots

```go
type PaginatedSnapshots struct {
    Items      []*Snapshot
    Total      int
    Page       int
    TotalPages int
}
```

<a name="Position"></a>
## type Position [#type-position]

Position represents a position in a document

```go
type Position struct {
    Line      int // zero-based
    Character int // zero-based
}
```

<a name="PreviewLink"></a>
## type PreviewLink [#type-previewlink]

PreviewLink contains the URL and authentication token for a sandbox preview.

```go
type PreviewLink struct {
    URL   string
    Token string
}
```

<a name="PtyResult"></a>
## type PtyResult [#type-ptyresult]

PtyResult represents PTY session exit information

```go
type PtyResult struct {
    ExitCode *int    // nil = process still running, non-nil = exit code
    Error    *string // nil = success, non-nil = error message
}
```

<a name="PtySessionInfo"></a>
## type PtySessionInfo [#type-ptysessioninfo]

PtySessionInfo represents PTY session information

```go
type PtySessionInfo struct {
    ID        string
    Active    bool
    CWD       string // Current working directory; may be empty unavailable
    Cols      int
    Rows      int
    ProcessID *int // Process ID; may be nil if unavailable
    CreatedAt time.Time
}
```

<a name="PtySize"></a>
## type PtySize [#type-ptysize]

PtySize represents terminal dimensions

```go
type PtySize struct {
    Rows int
    Cols int
}
```

<a name="Resources"></a>
## type Resources [#type-resources]

Resources represents resource allocation for a sandbox.

```go
type Resources struct {
    CPU     int
    GPU     int
    GpuType []GpuType
    Memory  int
    Disk    int
}
```

<a name="SandboxBaseParams"></a>
## type SandboxBaseParams [#type-sandboxbaseparams]

SandboxBaseParams contains common parameters for sandbox creation.

```go
type SandboxBaseParams struct {
    Name                string
    User                string
    Language            CodeLanguage
    EnvVars             map[string]string
    Labels              map[string]string
    Public              bool
    AutoStopInterval    *int // nil = no auto-stop, 0 = immediate stop
    AutoPauseInterval   *int // nil = server default when AutoStopInterval is also nil (60 for non-ephemeral pause-supporting classes, with auto-stop disabled), 0 = disabled. Only supported for sandbox classes that support pausing. Not allowed for ephemeral sandboxes. At most one of AutoPauseInterval and AutoStopInterval may be non-zero.
    AutoArchiveInterval *int // nil = no auto-archive, 0 = immediate archive
    AutoDeleteInterval  *int // nil = no auto-delete, 0 = immediate delete
    TtlMinutes          *int // Wall-clock max lifetime in minutes; 0 disables TTL
    // QueueTimeout is the minutes to wait for runner assignment before sandbox creation is cancelled.
    // Nil uses the organization default. Must be >= 1.
    QueueTimeout *int
    Volumes      []VolumeMount
    // Secrets maps an environment variable name to the name of an existing
    // organization secret. For each entry, the env var is injected into the
    // sandbox holding the secret's opaque placeholder, which is resolved to the
    // real value only when the sandbox connects to one of the secret's allowed
    // hosts. The referenced secrets must already exist (see [Client.Secret]).
    Secrets         map[string]string
    NetworkBlockAll bool
    // Kvm exposes KVM (/dev/kvm) inside the sandbox via nested virtualization.
    // linux-vm snapshots only. Requires the sandbox_kvm feature for the organization.
    Kvm              bool
    NetworkAllowList *string
    DomainAllowList  *string
    // OutboundProxyUrl is the outbound proxy URL the sandbox HTTP(S) traffic is
    // routed through. Applied via the HTTP(S)_PROXY environment variables;
    // combine with DomainAllowList for network-layer enforcement.
    OutboundProxyUrl *string
    // OtelEndpointOverride is the OTel collector endpoint override for the sandbox.
    // When set, sandbox OTel data is sent to this endpoint instead of the default
    // collector and will not be available in the Daytona analytics API or dashboard.
    OtelEndpointOverride *string
    Ephemeral            bool
    // Spot marks the sandbox as a spot GPU sandbox. A spot sandbox may be instantly
    // terminated without notice to free GPU capacity for an on-demand (non-spot) GPU
    // sandbox. Rejected when the sandbox requests no GPUs.
    Spot bool
    // LinkedSandbox is the ID or name of an existing sandbox to link the new sandbox to.
    // The new sandbox will be scheduled on the same runner as the linked sandbox so a local
    // network can be established between them.
    // Linked sandboxes must be ephemeral (AutoDeleteInterval=0) and cannot themselves be
    // linked to another sandbox.
    LinkedSandbox string
    // Target is the target (region) where the sandbox is created. It overrides the
    // client-level target for this call. When empty, the client-level target is used if
    // set; otherwise the organization's default region.
    Target string
}
```

<a name="SandboxClass"></a>
## type SandboxClass [#type-sandboxclass]

SandboxClass determines which runners can host sandboxes created from a snapshot. It is an alias for the API client's SandboxClass type.

```go
type SandboxClass = apiclient.SandboxClass
```

<a name="SandboxClassLinuxVM"></a>

```go
const (
    SandboxClassLinuxVM   SandboxClass = apiclient.SANDBOXCLASS_LINUX_VM
    SandboxClassContainer SandboxClass = apiclient.SANDBOXCLASS_CONTAINER
)
```

<a name="ScreenshotOptions"></a>
## type ScreenshotOptions [#type-screenshotoptions]



```go
type ScreenshotOptions struct {
    ShowCursor *bool    // nil = default, true = show, false = hide
    Format     *string  // nil = default format (PNG), or "jpeg", "webp", etc.
    Quality    *int     // nil = default quality, 0-100 for JPEG/WebP
    Scale      *float64 // nil = 1.0, scaling factor for the screenshot
}
```

<a name="ScreenshotRegion"></a>
## type ScreenshotRegion [#type-screenshotregion]

ScreenshotRegion represents a screenshot region

```go
type ScreenshotRegion struct {
    X      int
    Y      int
    Width  int
    Height int
}
```

<a name="ScreenshotResponse"></a>
## type ScreenshotResponse [#type-screenshotresponse]



```go
type ScreenshotResponse struct {
    Image     string // base64-encoded image data
    Width     int
    Height    int
    SizeBytes *int // Size in bytes
}
```

<a name="Secret"></a>
## type Secret [#type-secret]

Secret represents an organization\-scoped secret.

A Secret stores a write\-only plaintext value that is never returned by the API. When referenced from a sandbox, the env var holds the opaque [Secret.Placeholder](<#Secret>) token, which is resolved to the real value only for the secret's allowed [Secret.Hosts](<#Secret>).

```go
type Secret struct {
    ID          string  `json:"id"`
    Name        string  `json:"name"`
    Description *string `json:"description,omitempty"`
    // Placeholder is the opaque token injected as the env var value in sandboxes.
    Placeholder string `json:"placeholder"`
    // Hosts are the allowed hosts this secret may be sent to. Entries are exact
    // hostnames or "*." wildcards (without ports).
    Hosts     []string  `json:"hosts"`
    CreatedAt time.Time `json:"createdAt"`
    UpdatedAt time.Time `json:"updatedAt"`
}
```

<a name="SignedPreviewLink"></a>
## type SignedPreviewLink [#type-signedpreviewlink]

SignedPreviewLink contains the signed URL, authentication token, port, and sandbox ID for a sandbox preview.

```go
type SignedPreviewLink struct {
    SandboxID string
    Port      int
    Token     string
    URL       string
}
```

<a name="Snapshot"></a>
## type Snapshot [#type-snapshot]

Snapshot represents a Daytona snapshot

```go
type Snapshot struct {
    ID             string     `json:"id"`
    OrganizationID string     `json:"organizationId,omitempty"`
    General        bool       `json:"general"`
    Name           string     `json:"name"`
    ImageName      string     `json:"imageName,omitempty"`
    State          string     `json:"state"`
    Size           *float64   `json:"size,omitempty"`
    Entrypoint     []string   `json:"entrypoint,omitempty"`
    CPU            int        `json:"cpu"`
    GPU            int        `json:"gpu"`
    Memory         int        `json:"mem"` // API uses "mem" not "memory"
    Disk           int        `json:"disk"`
    ErrorReason    *string    `json:"errorReason,omitempty"` // nil = success, non-nil = error reason if snapshot failed
    SkipValidation bool       `json:"skipValidation"`
    CreatedAt      time.Time  `json:"createdAt"`
    UpdatedAt      time.Time  `json:"updatedAt"`
    LastUsedAt     *time.Time `json:"lastUsedAt,omitempty"`
    // ID of the sandbox the snapshot was created from; nil for snapshots not
    // created from a sandbox (e.g. registry-pulled or declaratively built)
    SourceSandboxID *string `json:"sourceSandboxId,omitempty"`
}
```

<a name="SnapshotParams"></a>
## type SnapshotParams [#type-snapshotparams]

SnapshotParams represents parameters for creating a sandbox from a snapshot

```go
type SnapshotParams struct {
    SandboxBaseParams
    Snapshot string
}
```

<a name="UpdateSecretParams"></a>
## type UpdateSecretParams [#type-updatesecretparams]

UpdateSecretParams contains parameters for updating a secret. Only the non\-nil fields are applied.

```go
type UpdateSecretParams struct {
    // Value is the new plaintext secret value. It is write-only and never returned.
    Value *string
    // Description is an optional human-readable description.
    Description *string
    // Hosts are the allowed hosts this secret may be sent to. Entries are exact
    // hostnames or "*." wildcards (without ports).
    Hosts []string
}
```

<a name="Volume"></a>
## type Volume [#type-volume]

Volume represents a Daytona volume

```go
type Volume struct {
    ID             string    `json:"id"`
    Name           string    `json:"name"`
    OrganizationID string    `json:"organizationId"`
    State          string    `json:"state"`
    ErrorReason    *string   `json:"errorReason,omitempty"`
    CreatedAt      time.Time `json:"createdAt"`
    UpdatedAt      time.Time `json:"updatedAt"`
    LastUsedAt     time.Time `json:"lastUsedAt,omitempty"`
}
```

<a name="VolumeMount"></a>
## type VolumeMount [#type-volumemount]

VolumeMount represents a volume mount configuration

```go
type VolumeMount struct {
    VolumeID  string // ID or name of the volume to mount
    MountPath string
    Subpath   *string // Optional subpath within the volume; nil = mount entire volume
}
```

<a name="WarmPool"></a>
## type WarmPool [#type-warmpool]

WarmPool represents a warm pool of ready\-to\-use sandboxes for a snapshot.

CurrentSize versus Pool is the pool's status: CurrentSize is the number of ready warm sandboxes, Pool is the desired number. ErrorReason is set when the pool cannot be filled.

```go
type WarmPool struct {
    ID             string `json:"id"`
    OrganizationID string `json:"organizationId"`
    // Snapshot is the snapshot the pool keeps warm sandboxes for.
    Snapshot string `json:"snapshot"`
    // Target is the target region of the pool.
    Target string `json:"target"`
    // Pool is the desired number of warm sandboxes.
    Pool int `json:"pool"`
    // CurrentSize is the current number of ready warm sandboxes in the pool.
    CurrentSize int               `json:"currentSize"`
    CPU         int               `json:"cpu"`
    Mem         int               `json:"mem"`
    Disk        int               `json:"disk"`
    OsUser      string            `json:"osUser"`
    Env         map[string]string `json:"env"`
    // ErrorReason is set when the pool cannot be filled.
    ErrorReason *string   `json:"errorReason,omitempty"`
    CreatedAt   time.Time `json:"createdAt"`
    UpdatedAt   time.Time `json:"updatedAt"`
}
```
