Documentation
¶
Index ¶
- Constants
- type APIConfig
- type APIError
- type Client
- func (c *Client) CreateSandbox(req *CreateSandboxRequest) (*Sandbox, error)
- func (c *Client) CreateSession(sandboxID, sessionID string) error
- func (c *Client) DeleteSandbox(sandboxID string, force bool) error
- func (c *Client) ExecuteCode(sandboxID string, req *ExecuteCodeRequest) (*ExecuteCodeResponse, error)
- func (c *Client) ExecuteCommand(sandboxID string, req *ExecuteCommandRequest) (*ExecuteCommandResponse, error)
- func (c *Client) ExecuteSessionCommand(sandboxID, sessionID, command string) (*SessionExecuteResponse, error)
- func (c *Client) FetchConfig() (*APIConfig, error)
- func (c *Client) GetSandbox(sandboxID string) (*Sandbox, error)
- func (c *Client) GetSession(sandboxID, sessionID string) (*Session, error)
- func (c *Client) GetSessionCommandLogs(sandboxID, sessionID, commandID string) (string, error)
- func (c *Client) ListSnapshots() ([]Snapshot, error)
- func (c *Client) Verify() error
- type Configuration
- type CreateSandbox
- func (c *CreateSandbox) Actions() []core.Action
- func (c *CreateSandbox) Cancel(ctx core.ExecutionContext) error
- func (c *CreateSandbox) Cleanup(ctx core.SetupContext) error
- func (c *CreateSandbox) Color() string
- func (c *CreateSandbox) Configuration() []configuration.Field
- func (c *CreateSandbox) Description() string
- func (c *CreateSandbox) Documentation() string
- func (c *CreateSandbox) ExampleOutput() map[string]any
- func (c *CreateSandbox) Execute(ctx core.ExecutionContext) error
- func (c *CreateSandbox) HandleAction(ctx core.ActionContext) error
- func (c *CreateSandbox) HandleWebhook(ctx core.WebhookRequestContext) (int, error)
- func (c *CreateSandbox) Icon() string
- func (c *CreateSandbox) Label() string
- func (c *CreateSandbox) Name() string
- func (c *CreateSandbox) OutputChannels(configuration any) []core.OutputChannel
- func (c *CreateSandbox) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (c *CreateSandbox) Setup(ctx core.SetupContext) error
- type CreateSandboxMetadata
- type CreateSandboxRequest
- type CreateSandboxSpec
- type Daytona
- func (d *Daytona) Actions() []core.Action
- func (d *Daytona) Cleanup(ctx core.IntegrationCleanupContext) error
- func (d *Daytona) Components() []core.Component
- func (d *Daytona) Configuration() []configuration.Field
- func (d *Daytona) Description() string
- func (d *Daytona) HandleAction(ctx core.IntegrationActionContext) error
- func (d *Daytona) HandleRequest(ctx core.HTTPRequestContext)
- func (d *Daytona) Icon() string
- func (d *Daytona) Instructions() string
- func (d *Daytona) Label() string
- func (d *Daytona) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)
- func (d *Daytona) Name() string
- func (d *Daytona) Sync(ctx core.SyncContext) error
- func (d *Daytona) Triggers() []core.Trigger
- type DeleteSandbox
- func (d *DeleteSandbox) Actions() []core.Action
- func (d *DeleteSandbox) Cancel(ctx core.ExecutionContext) error
- func (d *DeleteSandbox) Cleanup(ctx core.SetupContext) error
- func (d *DeleteSandbox) Color() string
- func (d *DeleteSandbox) Configuration() []configuration.Field
- func (d *DeleteSandbox) Description() string
- func (d *DeleteSandbox) Documentation() string
- func (d *DeleteSandbox) ExampleOutput() map[string]any
- func (d *DeleteSandbox) Execute(ctx core.ExecutionContext) error
- func (d *DeleteSandbox) HandleAction(ctx core.ActionContext) error
- func (d *DeleteSandbox) HandleWebhook(ctx core.WebhookRequestContext) (int, error)
- func (d *DeleteSandbox) Icon() string
- func (d *DeleteSandbox) Label() string
- func (d *DeleteSandbox) Name() string
- func (d *DeleteSandbox) OutputChannels(configuration any) []core.OutputChannel
- func (d *DeleteSandbox) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (d *DeleteSandbox) Setup(ctx core.SetupContext) error
- type DeleteSandboxPayload
- type DeleteSandboxSpec
- type EnvVariable
- type ExecuteCode
- func (e *ExecuteCode) Actions() []core.Action
- func (e *ExecuteCode) Cancel(ctx core.ExecutionContext) error
- func (e *ExecuteCode) Cleanup(ctx core.SetupContext) error
- func (e *ExecuteCode) Color() string
- func (e *ExecuteCode) Configuration() []configuration.Field
- func (e *ExecuteCode) Description() string
- func (e *ExecuteCode) Documentation() string
- func (e *ExecuteCode) ExampleOutput() map[string]any
- func (e *ExecuteCode) Execute(ctx core.ExecutionContext) error
- func (e *ExecuteCode) HandleAction(ctx core.ActionContext) error
- func (e *ExecuteCode) HandleWebhook(ctx core.WebhookRequestContext) (int, error)
- func (e *ExecuteCode) Icon() string
- func (e *ExecuteCode) Label() string
- func (e *ExecuteCode) Name() string
- func (e *ExecuteCode) OutputChannels(configuration any) []core.OutputChannel
- func (e *ExecuteCode) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (e *ExecuteCode) Setup(ctx core.SetupContext) error
- type ExecuteCodeMetadata
- type ExecuteCodeRequest
- type ExecuteCodeResponse
- type ExecuteCodeSpec
- type ExecuteCommand
- func (e *ExecuteCommand) Actions() []core.Action
- func (e *ExecuteCommand) Cancel(ctx core.ExecutionContext) error
- func (e *ExecuteCommand) Cleanup(ctx core.SetupContext) error
- func (e *ExecuteCommand) Color() string
- func (e *ExecuteCommand) Configuration() []configuration.Field
- func (e *ExecuteCommand) Description() string
- func (e *ExecuteCommand) Documentation() string
- func (e *ExecuteCommand) ExampleOutput() map[string]any
- func (e *ExecuteCommand) Execute(ctx core.ExecutionContext) error
- func (e *ExecuteCommand) HandleAction(ctx core.ActionContext) error
- func (e *ExecuteCommand) HandleWebhook(ctx core.WebhookRequestContext) (int, error)
- func (e *ExecuteCommand) Icon() string
- func (e *ExecuteCommand) Label() string
- func (e *ExecuteCommand) Name() string
- func (e *ExecuteCommand) OutputChannels(configuration any) []core.OutputChannel
- func (e *ExecuteCommand) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (e *ExecuteCommand) Setup(ctx core.SetupContext) error
- type ExecuteCommandMetadata
- type ExecuteCommandRequest
- type ExecuteCommandResponse
- type ExecuteCommandSpec
- type Metadata
- type PaginatedSnapshots
- type Sandbox
- type Session
- type SessionCommand
- type SessionExecuteRequest
- type SessionExecuteResponse
- type Snapshot
Constants ¶
const ( SandboxPayloadType = "daytona.sandbox" CreateSandboxPollInterval = 5 * time.Second CreateSandboxTimeout = 5 * time.Minute )
const ( ExecuteCodePayloadType = "daytona.execute.response" ExecuteCodePollInterval = 5 * time.Second )
const ( ExecuteCommandPayloadType = "daytona.command.response" ExecuteCommandPollInterval = 5 * time.Second )
const DeleteSandboxPayloadType = "daytona.delete.response"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIConfig ¶
type APIConfig struct {
ProxyToolboxURL string `json:"proxyToolboxUrl"`
}
APIConfig represents the relevant fields from the /api/config endpoint
type Client ¶
func NewClient ¶
func NewClient(httpClient core.HTTPContext, ctx core.IntegrationContext) (*Client, error)
func (*Client) CreateSandbox ¶
func (c *Client) CreateSandbox(req *CreateSandboxRequest) (*Sandbox, error)
CreateSandbox creates a new sandbox environment
func (*Client) CreateSession ¶ added in v0.9.0
CreateSession creates a new session on the sandbox toolbox
func (*Client) DeleteSandbox ¶
DeleteSandbox deletes a sandbox
func (*Client) ExecuteCode ¶
func (c *Client) ExecuteCode(sandboxID string, req *ExecuteCodeRequest) (*ExecuteCodeResponse, error)
ExecuteCode executes code in a sandbox (uses the execute command endpoint)
func (*Client) ExecuteCommand ¶
func (c *Client) ExecuteCommand(sandboxID string, req *ExecuteCommandRequest) (*ExecuteCommandResponse, error)
ExecuteCommand executes a shell command in a sandbox
func (*Client) ExecuteSessionCommand ¶ added in v0.9.0
func (c *Client) ExecuteSessionCommand(sandboxID, sessionID, command string) (*SessionExecuteResponse, error)
ExecuteSessionCommand executes a command asynchronously in a session
func (*Client) FetchConfig ¶
FetchConfig fetches the API configuration from the /api/config endpoint
func (*Client) GetSandbox ¶ added in v0.9.0
GetSandbox retrieves the current state of a sandbox
func (*Client) GetSession ¶ added in v0.9.0
GetSession retrieves the session state including command statuses
func (*Client) GetSessionCommandLogs ¶ added in v0.9.0
GetSessionCommandLogs retrieves the logs for a specific command in a session
func (*Client) ListSnapshots ¶
ListSnapshots lists available snapshots
type Configuration ¶
type CreateSandbox ¶
type CreateSandbox struct{}
func (*CreateSandbox) Actions ¶
func (c *CreateSandbox) Actions() []core.Action
func (*CreateSandbox) Cancel ¶
func (c *CreateSandbox) Cancel(ctx core.ExecutionContext) error
func (*CreateSandbox) Cleanup ¶ added in v0.7.0
func (c *CreateSandbox) Cleanup(ctx core.SetupContext) error
func (*CreateSandbox) Color ¶
func (c *CreateSandbox) Color() string
func (*CreateSandbox) Configuration ¶
func (c *CreateSandbox) Configuration() []configuration.Field
func (*CreateSandbox) Description ¶
func (c *CreateSandbox) Description() string
func (*CreateSandbox) Documentation ¶
func (c *CreateSandbox) Documentation() string
func (*CreateSandbox) ExampleOutput ¶
func (c *CreateSandbox) ExampleOutput() map[string]any
func (*CreateSandbox) Execute ¶
func (c *CreateSandbox) Execute(ctx core.ExecutionContext) error
func (*CreateSandbox) HandleAction ¶
func (c *CreateSandbox) HandleAction(ctx core.ActionContext) error
func (*CreateSandbox) HandleWebhook ¶
func (c *CreateSandbox) HandleWebhook(ctx core.WebhookRequestContext) (int, error)
func (*CreateSandbox) Icon ¶
func (c *CreateSandbox) Icon() string
func (*CreateSandbox) Label ¶
func (c *CreateSandbox) Label() string
func (*CreateSandbox) Name ¶
func (c *CreateSandbox) Name() string
func (*CreateSandbox) OutputChannels ¶
func (c *CreateSandbox) OutputChannels(configuration any) []core.OutputChannel
func (*CreateSandbox) ProcessQueueItem ¶
func (c *CreateSandbox) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
func (*CreateSandbox) Setup ¶
func (c *CreateSandbox) Setup(ctx core.SetupContext) error
type CreateSandboxMetadata ¶ added in v0.9.0
type CreateSandboxRequest ¶
type CreateSandboxRequest struct {
Snapshot string `json:"snapshot,omitempty"`
Target string `json:"target,omitempty"`
Env map[string]string `json:"env,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
AutoStopInterval int `json:"autoStopInterval,omitempty"`
}
CreateSandboxRequest represents the request to create a sandbox
type CreateSandboxSpec ¶
type CreateSandboxSpec struct {
Snapshot string `json:"snapshot,omitempty"`
Target string `json:"target,omitempty"`
AutoStopInterval int `json:"autoStopInterval,omitempty"`
Env []EnvVariable `json:"env,omitempty"`
}
type Daytona ¶
type Daytona struct{}
func (*Daytona) Components ¶
func (*Daytona) Configuration ¶
func (d *Daytona) Configuration() []configuration.Field
func (*Daytona) Description ¶
func (*Daytona) HandleAction ¶
func (d *Daytona) HandleAction(ctx core.IntegrationActionContext) error
func (*Daytona) HandleRequest ¶
func (d *Daytona) HandleRequest(ctx core.HTTPRequestContext)
func (*Daytona) Instructions ¶
func (*Daytona) ListResources ¶
func (d *Daytona) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)
type DeleteSandbox ¶
type DeleteSandbox struct{}
func (*DeleteSandbox) Actions ¶
func (d *DeleteSandbox) Actions() []core.Action
func (*DeleteSandbox) Cancel ¶
func (d *DeleteSandbox) Cancel(ctx core.ExecutionContext) error
func (*DeleteSandbox) Cleanup ¶ added in v0.7.0
func (d *DeleteSandbox) Cleanup(ctx core.SetupContext) error
func (*DeleteSandbox) Color ¶
func (d *DeleteSandbox) Color() string
func (*DeleteSandbox) Configuration ¶
func (d *DeleteSandbox) Configuration() []configuration.Field
func (*DeleteSandbox) Description ¶
func (d *DeleteSandbox) Description() string
func (*DeleteSandbox) Documentation ¶
func (d *DeleteSandbox) Documentation() string
func (*DeleteSandbox) ExampleOutput ¶
func (d *DeleteSandbox) ExampleOutput() map[string]any
func (*DeleteSandbox) Execute ¶
func (d *DeleteSandbox) Execute(ctx core.ExecutionContext) error
func (*DeleteSandbox) HandleAction ¶
func (d *DeleteSandbox) HandleAction(ctx core.ActionContext) error
func (*DeleteSandbox) HandleWebhook ¶
func (d *DeleteSandbox) HandleWebhook(ctx core.WebhookRequestContext) (int, error)
func (*DeleteSandbox) Icon ¶
func (d *DeleteSandbox) Icon() string
func (*DeleteSandbox) Label ¶
func (d *DeleteSandbox) Label() string
func (*DeleteSandbox) Name ¶
func (d *DeleteSandbox) Name() string
func (*DeleteSandbox) OutputChannels ¶
func (d *DeleteSandbox) OutputChannels(configuration any) []core.OutputChannel
func (*DeleteSandbox) ProcessQueueItem ¶
func (d *DeleteSandbox) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
func (*DeleteSandbox) Setup ¶
func (d *DeleteSandbox) Setup(ctx core.SetupContext) error
type DeleteSandboxPayload ¶
type DeleteSandboxSpec ¶
type EnvVariable ¶
type ExecuteCode ¶
type ExecuteCode struct{}
func (*ExecuteCode) Actions ¶
func (e *ExecuteCode) Actions() []core.Action
func (*ExecuteCode) Cancel ¶
func (e *ExecuteCode) Cancel(ctx core.ExecutionContext) error
func (*ExecuteCode) Cleanup ¶ added in v0.7.0
func (e *ExecuteCode) Cleanup(ctx core.SetupContext) error
func (*ExecuteCode) Color ¶
func (e *ExecuteCode) Color() string
func (*ExecuteCode) Configuration ¶
func (e *ExecuteCode) Configuration() []configuration.Field
func (*ExecuteCode) Description ¶
func (e *ExecuteCode) Description() string
func (*ExecuteCode) Documentation ¶
func (e *ExecuteCode) Documentation() string
func (*ExecuteCode) ExampleOutput ¶
func (e *ExecuteCode) ExampleOutput() map[string]any
func (*ExecuteCode) Execute ¶
func (e *ExecuteCode) Execute(ctx core.ExecutionContext) error
func (*ExecuteCode) HandleAction ¶
func (e *ExecuteCode) HandleAction(ctx core.ActionContext) error
func (*ExecuteCode) HandleWebhook ¶
func (e *ExecuteCode) HandleWebhook(ctx core.WebhookRequestContext) (int, error)
func (*ExecuteCode) Icon ¶
func (e *ExecuteCode) Icon() string
func (*ExecuteCode) Label ¶
func (e *ExecuteCode) Label() string
func (*ExecuteCode) Name ¶
func (e *ExecuteCode) Name() string
func (*ExecuteCode) OutputChannels ¶
func (e *ExecuteCode) OutputChannels(configuration any) []core.OutputChannel
func (*ExecuteCode) ProcessQueueItem ¶
func (e *ExecuteCode) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
func (*ExecuteCode) Setup ¶
func (e *ExecuteCode) Setup(ctx core.SetupContext) error
type ExecuteCodeMetadata ¶ added in v0.9.0
type ExecuteCodeMetadata struct {
SandboxID string `json:"sandboxId" mapstructure:"sandboxId"`
SessionID string `json:"sessionId" mapstructure:"sessionId"`
CmdID string `json:"cmdId" mapstructure:"cmdId"`
StartedAt int64 `json:"startedAt" mapstructure:"startedAt"`
Timeout int `json:"timeout" mapstructure:"timeout"`
}
type ExecuteCodeRequest ¶
type ExecuteCodeRequest struct {
Code string `json:"code"`
Language string `json:"language"`
Timeout int `json:"timeout,omitempty"`
}
ExecuteCodeRequest represents the request to execute code in a sandbox
type ExecuteCodeResponse ¶
ExecuteCodeResponse represents the response from code execution
type ExecuteCodeSpec ¶
type ExecuteCommand ¶
type ExecuteCommand struct{}
func (*ExecuteCommand) Actions ¶
func (e *ExecuteCommand) Actions() []core.Action
func (*ExecuteCommand) Cancel ¶
func (e *ExecuteCommand) Cancel(ctx core.ExecutionContext) error
func (*ExecuteCommand) Cleanup ¶ added in v0.7.0
func (e *ExecuteCommand) Cleanup(ctx core.SetupContext) error
func (*ExecuteCommand) Color ¶
func (e *ExecuteCommand) Color() string
func (*ExecuteCommand) Configuration ¶
func (e *ExecuteCommand) Configuration() []configuration.Field
func (*ExecuteCommand) Description ¶
func (e *ExecuteCommand) Description() string
func (*ExecuteCommand) Documentation ¶
func (e *ExecuteCommand) Documentation() string
func (*ExecuteCommand) ExampleOutput ¶
func (e *ExecuteCommand) ExampleOutput() map[string]any
func (*ExecuteCommand) Execute ¶
func (e *ExecuteCommand) Execute(ctx core.ExecutionContext) error
func (*ExecuteCommand) HandleAction ¶
func (e *ExecuteCommand) HandleAction(ctx core.ActionContext) error
func (*ExecuteCommand) HandleWebhook ¶
func (e *ExecuteCommand) HandleWebhook(ctx core.WebhookRequestContext) (int, error)
func (*ExecuteCommand) Icon ¶
func (e *ExecuteCommand) Icon() string
func (*ExecuteCommand) Label ¶
func (e *ExecuteCommand) Label() string
func (*ExecuteCommand) Name ¶
func (e *ExecuteCommand) Name() string
func (*ExecuteCommand) OutputChannels ¶
func (e *ExecuteCommand) OutputChannels(configuration any) []core.OutputChannel
func (*ExecuteCommand) ProcessQueueItem ¶
func (e *ExecuteCommand) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
func (*ExecuteCommand) Setup ¶
func (e *ExecuteCommand) Setup(ctx core.SetupContext) error
type ExecuteCommandMetadata ¶ added in v0.9.0
type ExecuteCommandMetadata struct {
SandboxID string `json:"sandboxId" mapstructure:"sandboxId"`
SessionID string `json:"sessionId" mapstructure:"sessionId"`
CmdID string `json:"cmdId" mapstructure:"cmdId"`
StartedAt int64 `json:"startedAt" mapstructure:"startedAt"`
Timeout int `json:"timeout" mapstructure:"timeout"`
}
type ExecuteCommandRequest ¶
type ExecuteCommandRequest struct {
Command string `json:"command"`
Cwd string `json:"cwd,omitempty"`
Timeout int `json:"timeout,omitempty"`
}
ExecuteCommandRequest represents the request to execute a command in a sandbox
type ExecuteCommandResponse ¶
ExecuteCommandResponse represents the response from command execution
type ExecuteCommandSpec ¶
type PaginatedSnapshots ¶
type PaginatedSnapshots struct {
Items []Snapshot `json:"items"`
}
PaginatedSnapshots represents a paginated list of snapshots
type Session ¶ added in v0.9.0
type Session struct {
SessionID string `json:"sessionId"`
Commands []SessionCommand `json:"commands"`
}
Session represents a Daytona session with its commands
func (*Session) FindCommand ¶ added in v0.9.0
func (s *Session) FindCommand(cmdID string) *SessionCommand
FindCommand returns the command with the given ID, or nil if not found
type SessionCommand ¶ added in v0.9.0
SessionCommand represents a command within a session
type SessionExecuteRequest ¶ added in v0.9.0
type SessionExecuteRequest struct {
Command string `json:"command"`
RunAsync bool `json:"runAsync"`
}
SessionExecuteRequest is the request body for executing a command in a session
type SessionExecuteResponse ¶ added in v0.9.0
type SessionExecuteResponse struct {
CmdID string `json:"cmdId"`
}
SessionExecuteResponse is the response from executing a command in a session