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

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

## Index

- [type Chart](<#Chart>)
- [type ChartType](<#ChartType>)
- [type CodeLanguage](<#CodeLanguage>)
- [type CodeRunParams](<#CodeRunParams>)
- [type CreateSnapshotParams](<#CreateSnapshotParams>)
- [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 GitStatus](<#GitStatus>)
- [type ImageParams](<#ImageParams>)
- [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 ScreenshotOptions](<#ScreenshotOptions>)
- [type ScreenshotRegion](<#ScreenshotRegion>)
- [type ScreenshotResponse](<#ScreenshotResponse>)
- [type Snapshot](<#Snapshot>)
- [type SnapshotParams](<#SnapshotParams>)
- [type Volume](<#Volume>)
- [type VolumeMount](<#VolumeMount>)

<a name="Chart"></a>
## type Chart

Chart represents a chart

```go
type Chart struct {
    Type     ChartType
    Title    string
    Elements any
    PNG      *string // Optional base64-encoded PNG representation
}
```

<a name="ChartType"></a>
## type ChartType

```go
type ChartType string
```

<a name="ChartTypeLine"></a>

```go
const (
    ChartTypeLine           ChartType = "line"
    ChartTypeScatter        ChartType = "scatter"
    ChartTypeBar            ChartType = "bar"
    ChartTypePie            ChartType = "pie"
    ChartTypeBoxAndWhisker  ChartType = "box_and_whisker"
    ChartTypeCompositeChart ChartType = "composite_chart"
    ChartTypeUnknown        ChartType = "unknown"
)
```

<a name="CodeLanguage"></a>
## 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

CodeRunParams represents parameters for code execution

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

<a name="CreateSnapshotParams"></a>
## 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
}
```

<a name="DaytonaConfig"></a>
## 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         string
    Experimental   *ExperimentalConfig
}
```

<a name="ExecuteResponse"></a>
## 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

ExecutionArtifacts represents execution output artifacts

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

<a name="ExecutionError"></a>
## 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
}
```

<a name="ExecutionResult"></a>
## 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

ExperimentalConfig holds experimental feature flags for the Daytona client.

```go
type ExperimentalConfig struct {
    OtelEnabled bool // Enable OpenTelemetry tracing and metrics
}
```

<a name="FileDownloadRequest"></a>
## 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

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

FileInfo represents file metadata

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

<a name="FileStatus"></a>
## 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

FileUpload represents a file to upload

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

<a name="GitCommitResponse"></a>
## type GitCommitResponse

GitCommitResponse

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

<a name="GitStatus"></a>
## type GitStatus

GitStatus represents git repository status

```go
type GitStatus struct {
    CurrentBranch   string
    Ahead           int
    Behind          int
    BranchPublished bool
    FileStatus      []FileStatus
}
```

<a name="ImageParams"></a>
## 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="LspLanguageID"></a>
## 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

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

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

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

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

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

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

PtySize represents terminal dimensions

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

<a name="Resources"></a>
## type Resources

Resources represents resource allocation for a sandbox.

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

<a name="SandboxBaseParams"></a>
## 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
    AutoArchiveInterval *int // nil = no auto-archive, 0 = immediate archive
    AutoDeleteInterval  *int // nil = no auto-delete, 0 = immediate delete
    Volumes             []VolumeMount
    NetworkBlockAll     bool
    NetworkAllowList    *string
    Ephemeral           bool
}
```

<a name="ScreenshotOptions"></a>
## 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

ScreenshotRegion represents a screenshot region

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

<a name="ScreenshotResponse"></a>
## type ScreenshotResponse

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

<a name="Snapshot"></a>
## 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"`
}
```

<a name="SnapshotParams"></a>
## type SnapshotParams

SnapshotParams represents parameters for creating a sandbox from a snapshot

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

<a name="Volume"></a>
## 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

VolumeMount represents a volume mount configuration

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

