Documentation
¶
Index ¶
- func TemplateToDockerfile(template *Template) (string, error)
- func TemplateToJSON(template *Template, computeHashes bool) (string, error)
- type Client
- func (c *Client) BuildTemplate(ctx context.Context, template *Template, name string, ...) (*TemplateBuildInfo, error)
- func (c *Client) BuildTemplateInBackground(ctx context.Context, template *Template, name string, ...) (*TemplateBuildInfo, error)
- func (c *Client) Connect(ctx context.Context, sandboxID string) (*Sandbox, error)
- func (c *Client) ConnectSandbox(ctx context.Context, sandboxID string) (*ConnectSandboxResponse, error)
- func (c *Client) Create(ctx context.Context, templateID string, opts *CreateOptions) (*Sandbox, error)
- func (c *Client) CreateSandbox(ctx context.Context, req *control.NewSandboxRequest) (*Sandbox, error)
- func (c *Client) CreateWorkspace(ctx context.Context, templateID string) (*Workspace, error)
- func (c *Client) DeleteTemplate(ctx context.Context, ref string) error
- func (c *Client) DeleteWorkspace(ctx context.Context, workspaceID string) error
- func (c *Client) Get(ctx context.Context, sandboxID string) (*SandboxDetail, error)
- func (c *Client) GetSandbox(ctx context.Context, sandboxID string) (*SandboxDetail, error)
- func (c *Client) GetTemplate(ctx context.Context, ref string, opts *TemplateGetOptions) (*build.TemplateResponse, error)
- func (c *Client) GetTemplateBuildStatus(ctx context.Context, templateID, buildID string, ...) (*build.BuildStatusResponse, error)
- func (c *Client) GetWorkspace(ctx context.Context, workspaceID string) (*Workspace, error)
- func (c *Client) List(ctx context.Context, opts *ListOptions) ([]*SandboxHandle, error)
- func (c *Client) ListSandboxes(ctx context.Context, params *control.ListSandboxesParams) ([]*SandboxHandle, error)
- func (c *Client) ListTemplates(ctx context.Context, opts *TemplateListOptions) ([]build.ListedTemplate, error)
- func (c *Client) ListWorkspaces(ctx context.Context) ([]Workspace, error)
- func (c *Client) NewCMD(baseURL, accessToken string) (*cmd.Service, error)
- func (c *Client) PromoteSandboxWorkspace(ctx context.Context, sandboxID string) (*Workspace, error)
- func (c *Client) Runtime(baseURL, accessToken string) (*Runtime, error)
- func (c *Client) RuntimeFromDetail(sandbox *control.SandboxDetail) (*Runtime, error)
- func (c *Client) RuntimeFromSandbox(sandbox *control.Sandbox) (*Runtime, error)
- func (c *Client) TemplateAliasExists(ctx context.Context, alias string) (bool, error)
- func (c *Client) TemplateExists(ctx context.Context, ref string) (bool, error)
- type CommandHandle
- func (h *CommandHandle) Close() error
- func (h *CommandHandle) CloseStdin(ctx context.Context) error
- func (h *CommandHandle) Kill(ctx context.Context) (bool, error)
- func (h *CommandHandle) SendStdin(ctx context.Context, data string) error
- func (h *CommandHandle) Wait(ctx context.Context) (*CommandWaitResult, error)
- type CommandResult
- type CommandRunOptions
- type CommandWaitResult
- type CommandsModule
- func (m *CommandsModule) Connect(ctx context.Context, pid int) (*CommandHandle, error)
- func (m *CommandsModule) Exec(ctx context.Context, command string, opts *CommandRunOptions) (*CommandResult, error)
- func (m *CommandsModule) Kill(ctx context.Context, pid int) (bool, error)
- func (m *CommandsModule) List(ctx context.Context) ([]cmd.ProcessInfo, error)
- func (m *CommandsModule) Run(ctx context.Context, command string, opts *CommandRunOptions) (*CommandResult, error)
- func (m *CommandsModule) SendStdin(ctx context.Context, pid int, data string) error
- func (m *CommandsModule) Start(ctx context.Context, command string, opts *CommandRunOptions) (*CommandHandle, error)
- type ConnectSandboxResponse
- type CreateOptions
- type FilesystemModule
- func (m *FilesystemModule) Exists(ctx context.Context, path string) (bool, error)
- func (m *FilesystemModule) GetInfo(ctx context.Context, path string) (*cmd.EntryInfo, error)
- func (m *FilesystemModule) List(ctx context.Context, path string, depth *int) ([]cmd.EntryInfo, error)
- func (m *FilesystemModule) MakeDir(ctx context.Context, path string) (bool, error)
- func (m *FilesystemModule) Read(ctx context.Context, path string) (string, error)
- func (m *FilesystemModule) Remove(ctx context.Context, path string) error
- func (m *FilesystemModule) Rename(ctx context.Context, oldPath, newPath string) (*cmd.EntryInfo, error)
- func (m *FilesystemModule) WatchDir(ctx context.Context, path string, recursive *bool) (*cmd.FilesystemWatchStream, error)
- func (m *FilesystemModule) Write(ctx context.Context, path string, data []byte) (*WriteInfo, error)
- func (m *FilesystemModule) WriteFiles(ctx context.Context, files []cmd.WriteFileEntry) ([]WriteInfo, error)
- type GatewayConfig
- type GitCloneOptions
- type GitCommandOptions
- type GitModule
- func (m *GitModule) Checkout(ctx context.Context, ref, path string, opts *GitCommandOptions) (*CommandResult, error)
- func (m *GitModule) Clone(ctx context.Context, repoURL, path string, opts *GitCloneOptions) (*CommandResult, error)
- func (m *GitModule) Pull(ctx context.Context, path string, opts *GitCommandOptions) (*CommandResult, error)
- func (m *GitModule) Status(ctx context.Context, path string, opts *GitCommandOptions) (*CommandResult, error)
- type ListOptions
- type LogEntry
- type PtyCreateOptions
- type PtyModule
- func (m *PtyModule) Connect(ctx context.Context, pid int) (*CommandHandle, error)
- func (m *PtyModule) Create(ctx context.Context, command string, opts *PtyCreateOptions) (*CommandHandle, error)
- func (m *PtyModule) Kill(ctx context.Context, pid int) (bool, error)
- func (m *PtyModule) Resize(ctx context.Context, pid int, size cmd.PtySize) error
- func (m *PtyModule) SendStdin(ctx context.Context, pid int, data string) error
- type ReadyCmd
- type ResourceOperationError
- type Runtime
- type Sandbox
- func (s *Sandbox) Commands() (*CommandsModule, error)
- func (s *Sandbox) Connect(ctx context.Context) (*ConnectSandboxResponse, error)
- func (s *Sandbox) Delete(ctx context.Context) error
- func (s *Sandbox) Files() (*FilesystemModule, error)
- func (s *Sandbox) GetHost(port int) (string, error)
- func (s *Sandbox) GetInfo(ctx context.Context) (*SandboxDetail, error)
- func (s *Sandbox) GetMetrics(ctx context.Context) (*cmd.MetricsResponse, error)
- func (s *Sandbox) Git() (*GitModule, error)
- func (s *Sandbox) IsRunning() bool
- func (s *Sandbox) Kill(ctx context.Context) error
- func (s *Sandbox) Logs(ctx context.Context, params *control.SandboxLogsParams) (*control.SandboxLogsResponse, error)
- func (s *Sandbox) Pause(ctx context.Context) error
- func (s *Sandbox) Proxy(ctx context.Context, req *cmd.ProxyRequest) (*http.Response, error)
- func (s *Sandbox) Pty() (*PtyModule, error)
- func (s *Sandbox) Refresh(ctx context.Context, req *control.RefreshSandboxRequest) error
- func (s *Sandbox) Reload(ctx context.Context) (*SandboxDetail, error)
- func (s *Sandbox) Resume(ctx context.Context) (*Sandbox, error)
- func (s *Sandbox) Runtime() (*Runtime, error)
- func (s *Sandbox) SetTimeout(ctx context.Context, req *control.TimeoutRequest) error
- type SandboxDetail
- func (s *SandboxDetail) Commands() (*CommandsModule, error)
- func (s *SandboxDetail) Connect(ctx context.Context) (*ConnectSandboxResponse, error)
- func (s *SandboxDetail) Delete(ctx context.Context) error
- func (s *SandboxDetail) Files() (*FilesystemModule, error)
- func (s *SandboxDetail) GetHost(port int) (string, error)
- func (s *SandboxDetail) GetInfo(ctx context.Context) (*SandboxDetail, error)
- func (s *SandboxDetail) GetMetrics(ctx context.Context) (*cmd.MetricsResponse, error)
- func (s *SandboxDetail) Git() (*GitModule, error)
- func (s *SandboxDetail) IsRunning() bool
- func (s *SandboxDetail) Kill(ctx context.Context) error
- func (s *SandboxDetail) Logs(ctx context.Context, params *control.SandboxLogsParams) (*control.SandboxLogsResponse, error)
- func (s *SandboxDetail) Pause(ctx context.Context) error
- func (s *SandboxDetail) Proxy(ctx context.Context, req *cmd.ProxyRequest) (*http.Response, error)
- func (s *SandboxDetail) Pty() (*PtyModule, error)
- func (s *SandboxDetail) Refresh(ctx context.Context, req *control.RefreshSandboxRequest) error
- func (s *SandboxDetail) Reload(ctx context.Context) (*SandboxDetail, error)
- func (s *SandboxDetail) Resume(ctx context.Context) (*Sandbox, error)
- func (s *SandboxDetail) Runtime() (*Runtime, error)
- func (s *SandboxDetail) SetTimeout(ctx context.Context, req *control.TimeoutRequest) error
- type SandboxHandle
- func (s *SandboxHandle) Connect(ctx context.Context) (*ConnectSandboxResponse, error)
- func (s *SandboxHandle) Delete(ctx context.Context) error
- func (s *SandboxHandle) GetInfo(ctx context.Context) (*SandboxDetail, error)
- func (s *SandboxHandle) IsRunning() bool
- func (s *SandboxHandle) Kill(ctx context.Context) error
- func (s *SandboxHandle) Logs(ctx context.Context, params *control.SandboxLogsParams) (*control.SandboxLogsResponse, error)
- func (s *SandboxHandle) Pause(ctx context.Context) error
- func (s *SandboxHandle) Refresh(ctx context.Context, req *control.RefreshSandboxRequest) error
- func (s *SandboxHandle) Reload(ctx context.Context) (*SandboxDetail, error)
- func (s *SandboxHandle) Resume(ctx context.Context) (*Sandbox, error)
- func (s *SandboxHandle) SetTimeout(ctx context.Context, req *control.TimeoutRequest) error
- type Template
- func (t *Template) AptInstall(packages []string, opts *TemplateAptInstallOptions) *Template
- func (t *Template) BunInstall(packages []string, opts *TemplateBunInstallOptions) *Template
- func (t *Template) Copy(src, dest string, opts *TemplateCopyOptions) *Template
- func (t *Template) CopyItems(items []TemplateCopyItem) *Template
- func (t *Template) FromAWSRegistry(image, accessKeyID, secretAccessKey, region string) *Template
- func (t *Template) FromBaseImage() *Template
- func (t *Template) FromBunImage(variant string) *Template
- func (t *Template) FromDebianImage(variant string) *Template
- func (t *Template) FromDockerfile(dockerfileContentOrPath string) (*Template, error)
- func (t *Template) FromGCPRegistry(image string, serviceAccountJSON any) *Template
- func (t *Template) FromImage(image string, registryConfig ...map[string]any) *Template
- func (t *Template) FromNodeImage(variant string) *Template
- func (t *Template) FromPythonImage(version string) *Template
- func (t *Template) FromTemplate(templateID string) *Template
- func (t *Template) FromUbuntuImage(variant string) *Template
- func (t *Template) GitClone(repoURL, path string, opts *TemplateGitCloneOptions) *Template
- func (t *Template) MakeDir(paths []string, opts *TemplateMakeDirOptions) *Template
- func (t *Template) MakeSymlink(src, dest string, opts *TemplateMakeSymlinkOptions) *Template
- func (t *Template) NpmInstall(packages []string, opts *TemplateNpmInstallOptions) *Template
- func (t *Template) PipInstall(packages []string, opts *TemplatePipInstallOptions) *Template
- func (t *Template) Remove(paths []string, opts *TemplateRemoveOptions) *Template
- func (t *Template) Rename(src, dest string, opts *TemplateRenameOptions) *Template
- func (t *Template) Request() *build.BuildRequest
- func (t *Template) RunCmd(command string, opts *TemplateCommandOptions) *Template
- func (t *Template) RunCmds(commands []string, opts *TemplateCommandOptions) *Template
- func (t *Template) SetEnvs(envs map[string]string) *Template
- func (t *Template) SetReadyCmd(readyCommand ReadyCmd) *Template
- func (t *Template) SetStartCmd(startCommand string, readyCommand ReadyCmd) *Template
- func (t *Template) SetUser(user string) *Template
- func (t *Template) SetWorkdir(path string) *Template
- func (t *Template) SkipCache() *Template
- type TemplateAptInstallOptions
- type TemplateBuildInfo
- type TemplateBuildOptions
- type TemplateBuildStatusOptions
- type TemplateBunInstallOptions
- type TemplateCommandOptions
- type TemplateCopyItem
- type TemplateCopyOptions
- type TemplateGetOptions
- type TemplateGitCloneOptions
- type TemplateListOptions
- type TemplateMakeDirOptions
- type TemplateMakeSymlinkOptions
- type TemplateNpmInstallOptions
- type TemplatePathOptions
- type TemplatePipInstallOptions
- type TemplateRemoveOptions
- type TemplateRenameOptions
- type Workspace
- type WorkspaceMount
- type WriteInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TemplateToDockerfile ¶
TemplateToDockerfile converts the currently supported template subset into a Dockerfile string.
Types ¶
type Client ¶
func NewClient ¶
func NewClient(baseURL, apiKey string, opts ...core.TransportOption) (*Client, error)
func (*Client) BuildTemplate ¶
func (c *Client) BuildTemplate(ctx context.Context, template *Template, name string, opts *TemplateBuildOptions) (*TemplateBuildInfo, error)
func (*Client) BuildTemplateInBackground ¶
func (c *Client) BuildTemplateInBackground(ctx context.Context, template *Template, name string, opts *TemplateBuildOptions) (*TemplateBuildInfo, error)
func (*Client) Connect ¶
Connect resumes a paused Sandbox or retrieves a running Sandbox's current connection details. It never modifies the Sandbox lifetime.
func (*Client) ConnectSandbox ¶
func (*Client) CreateSandbox ¶
func (*Client) CreateWorkspace ¶ added in v0.1.4
CreateWorkspace creates an empty persistent Workspace for an NFS-backed template owned by the caller.
func (*Client) DeleteTemplate ¶
func (*Client) DeleteWorkspace ¶ added in v0.1.4
DeleteWorkspace deletes a detached Workspace record. The server returns a conflict while a Sandbox holds it or a pending create lease is active.
func (*Client) GetSandbox ¶
func (*Client) GetTemplate ¶
func (c *Client) GetTemplate(ctx context.Context, ref string, opts *TemplateGetOptions) (*build.TemplateResponse, error)
func (*Client) GetTemplateBuildStatus ¶
func (c *Client) GetTemplateBuildStatus(ctx context.Context, templateID, buildID string, opts *TemplateBuildStatusOptions) (*build.BuildStatusResponse, error)
func (*Client) GetWorkspace ¶ added in v0.1.4
GetWorkspace returns one caller-owned Workspace. Foreign Workspaces are deliberately non-enumerable and return not found.
func (*Client) List ¶
func (c *Client) List(ctx context.Context, opts *ListOptions) ([]*SandboxHandle, error)
func (*Client) ListSandboxes ¶
func (c *Client) ListSandboxes( ctx context.Context, params *control.ListSandboxesParams, ) ([]*SandboxHandle, error)
func (*Client) ListTemplates ¶
func (c *Client) ListTemplates(ctx context.Context, opts *TemplateListOptions) ([]build.ListedTemplate, error)
func (*Client) ListWorkspaces ¶ added in v0.1.4
ListWorkspaces lists Workspaces owned by the authenticated caller.
func (*Client) PromoteSandboxWorkspace ¶ added in v0.1.4
PromoteSandboxWorkspace adopts an existing legacy NFS Sandbox directory as a Workspace without copying its contents. The Sandbox must be owned by the caller and use an NFS workspace mount.
func (*Client) RuntimeFromDetail ¶
func (c *Client) RuntimeFromDetail(sandbox *control.SandboxDetail) (*Runtime, error)
func (*Client) RuntimeFromSandbox ¶
func (*Client) TemplateAliasExists ¶
type CommandHandle ¶
type CommandHandle struct {
PID int
CmdID string
PTY bool
// contains filtered or unexported fields
}
func (*CommandHandle) Close ¶
func (h *CommandHandle) Close() error
func (*CommandHandle) CloseStdin ¶
func (h *CommandHandle) CloseStdin(ctx context.Context) error
func (*CommandHandle) SendStdin ¶
func (h *CommandHandle) SendStdin(ctx context.Context, data string) error
func (*CommandHandle) Wait ¶
func (h *CommandHandle) Wait(ctx context.Context) (*CommandWaitResult, error)
type CommandResult ¶
type CommandRunOptions ¶
type CommandWaitResult ¶
type CommandsModule ¶
type CommandsModule struct {
// contains filtered or unexported fields
}
func (*CommandsModule) Connect ¶
func (m *CommandsModule) Connect(ctx context.Context, pid int) (*CommandHandle, error)
func (*CommandsModule) Exec ¶
func (m *CommandsModule) Exec(ctx context.Context, command string, opts *CommandRunOptions) (*CommandResult, error)
func (*CommandsModule) List ¶
func (m *CommandsModule) List(ctx context.Context) ([]cmd.ProcessInfo, error)
func (*CommandsModule) Run ¶
func (m *CommandsModule) Run(ctx context.Context, command string, opts *CommandRunOptions) (*CommandResult, error)
func (*CommandsModule) Start ¶
func (m *CommandsModule) Start(ctx context.Context, command string, opts *CommandRunOptions) (*CommandHandle, error)
type ConnectSandboxResponse ¶
type CreateOptions ¶
type CreateOptions struct {
GatewayConfig
TemplateID string
WorkspaceID string
WorkspaceMounts []WorkspaceMount
Timeout *int32
Metadata map[string]string
EnvVars map[string]string
// Deprecated: Runtime volume mounts are unsupported. Configure volumes on
// the Sandbox Template instead. This field is retained for source
// compatibility and Create rejects a non-empty value locally.
VolumeMounts []control.VolumeMount
WaitReady *bool
AutoPause *bool
WaitTimeout time.Duration
PollInterval time.Duration
}
type FilesystemModule ¶
type FilesystemModule struct {
// contains filtered or unexported fields
}
func (*FilesystemModule) Remove ¶
func (m *FilesystemModule) Remove(ctx context.Context, path string) error
func (*FilesystemModule) WatchDir ¶
func (m *FilesystemModule) WatchDir(ctx context.Context, path string, recursive *bool) (*cmd.FilesystemWatchStream, error)
func (*FilesystemModule) WriteFiles ¶
func (m *FilesystemModule) WriteFiles(ctx context.Context, files []cmd.WriteFileEntry) ([]WriteInfo, error)
type GatewayConfig ¶
type GitCloneOptions ¶
type GitCloneOptions struct {
GitCommandOptions
Branch string
Depth int
}
type GitCommandOptions ¶
type GitModule ¶
type GitModule struct {
// contains filtered or unexported fields
}
func (*GitModule) Checkout ¶
func (m *GitModule) Checkout(ctx context.Context, ref, path string, opts *GitCommandOptions) (*CommandResult, error)
func (*GitModule) Clone ¶
func (m *GitModule) Clone(ctx context.Context, repoURL, path string, opts *GitCloneOptions) (*CommandResult, error)
func (*GitModule) Pull ¶
func (m *GitModule) Pull(ctx context.Context, path string, opts *GitCommandOptions) (*CommandResult, error)
func (*GitModule) Status ¶
func (m *GitModule) Status(ctx context.Context, path string, opts *GitCommandOptions) (*CommandResult, error)
type ListOptions ¶
type PtyCreateOptions ¶
type PtyModule ¶
type PtyModule struct {
// contains filtered or unexported fields
}
func (*PtyModule) Create ¶
func (m *PtyModule) Create(ctx context.Context, command string, opts *PtyCreateOptions) (*CommandHandle, error)
type ReadyCmd ¶
type ReadyCmd struct {
// contains filtered or unexported fields
}
func WaitForCommand ¶
WaitForCommand uses a caller-provided command as the template readiness probe.
func WaitForFile ¶
func WaitForPort ¶
func WaitForProcess ¶
func WaitForTimeout ¶
func WaitForURL ¶
type ResourceOperationError ¶
type ResourceOperationError struct {
Operation string
ResourceType string
ResourceID string
RelatedID string
CleanupAttempted bool
CleanupErr error
Err error
}
ResourceOperationError preserves resource identity after a partially successful operation.
func (*ResourceOperationError) Error ¶
func (e *ResourceOperationError) Error() string
func (*ResourceOperationError) Unwrap ¶
func (e *ResourceOperationError) Unwrap() error
type Sandbox ¶
func (*Sandbox) Commands ¶
func (s *Sandbox) Commands() (*CommandsModule, error)
func (*Sandbox) Connect ¶
func (s *Sandbox) Connect(ctx context.Context) (*ConnectSandboxResponse, error)
func (*Sandbox) Files ¶
func (s *Sandbox) Files() (*FilesystemModule, error)
func (*Sandbox) GetInfo ¶
func (s *Sandbox) GetInfo(ctx context.Context) (*SandboxDetail, error)
GetInfo fetches the latest sandbox detail for this sandbox ID.
func (*Sandbox) GetMetrics ¶
GetMetrics reads runtime metrics for sandboxes that expose nano-executor access.
func (*Sandbox) Logs ¶
func (s *Sandbox) Logs(ctx context.Context, params *control.SandboxLogsParams) (*control.SandboxLogsResponse, error)
func (*Sandbox) Resume ¶
Resume reconnects to a paused sandbox and returns the running sandbox handle without changing its configured lifetime.
func (*Sandbox) SetTimeout ¶
type SandboxDetail ¶
type SandboxDetail struct {
*control.SandboxDetail
// contains filtered or unexported fields
}
func (*SandboxDetail) Commands ¶
func (s *SandboxDetail) Commands() (*CommandsModule, error)
func (*SandboxDetail) Connect ¶
func (s *SandboxDetail) Connect(ctx context.Context) (*ConnectSandboxResponse, error)
func (*SandboxDetail) Files ¶
func (s *SandboxDetail) Files() (*FilesystemModule, error)
func (*SandboxDetail) GetInfo ¶
func (s *SandboxDetail) GetInfo(ctx context.Context) (*SandboxDetail, error)
GetInfo refreshes the sandbox detail for this sandbox ID.
func (*SandboxDetail) GetMetrics ¶
func (s *SandboxDetail) GetMetrics(ctx context.Context) (*cmd.MetricsResponse, error)
GetMetrics reads runtime metrics for sandboxes that expose nano-executor access.
func (*SandboxDetail) Git ¶
func (s *SandboxDetail) Git() (*GitModule, error)
func (*SandboxDetail) IsRunning ¶
func (s *SandboxDetail) IsRunning() bool
IsRunning reports whether the sandbox is in an active state.
func (*SandboxDetail) Kill ¶
func (s *SandboxDetail) Kill(ctx context.Context) error
Kill deletes the sandbox.
func (*SandboxDetail) Logs ¶
func (s *SandboxDetail) Logs(ctx context.Context, params *control.SandboxLogsParams) (*control.SandboxLogsResponse, error)
func (*SandboxDetail) Proxy ¶
func (s *SandboxDetail) Proxy(ctx context.Context, req *cmd.ProxyRequest) (*http.Response, error)
func (*SandboxDetail) Pty ¶
func (s *SandboxDetail) Pty() (*PtyModule, error)
func (*SandboxDetail) Refresh ¶
func (s *SandboxDetail) Refresh(ctx context.Context, req *control.RefreshSandboxRequest) error
func (*SandboxDetail) Reload ¶
func (s *SandboxDetail) Reload(ctx context.Context) (*SandboxDetail, error)
func (*SandboxDetail) Resume ¶
func (s *SandboxDetail) Resume(ctx context.Context) (*Sandbox, error)
Resume reconnects to a paused sandbox detail and returns a running sandbox handle without changing its configured lifetime.
func (*SandboxDetail) Runtime ¶
func (s *SandboxDetail) Runtime() (*Runtime, error)
func (*SandboxDetail) SetTimeout ¶
func (s *SandboxDetail) SetTimeout(ctx context.Context, req *control.TimeoutRequest) error
type SandboxHandle ¶
type SandboxHandle struct {
*control.ListedSandbox
// contains filtered or unexported fields
}
func (*SandboxHandle) Connect ¶
func (s *SandboxHandle) Connect(ctx context.Context) (*ConnectSandboxResponse, error)
func (*SandboxHandle) GetInfo ¶
func (s *SandboxHandle) GetInfo(ctx context.Context) (*SandboxDetail, error)
GetInfo fetches the latest sandbox detail for this sandbox ID.
func (*SandboxHandle) IsRunning ¶
func (s *SandboxHandle) IsRunning() bool
IsRunning reports whether the sandbox is in an active state.
func (*SandboxHandle) Kill ¶
func (s *SandboxHandle) Kill(ctx context.Context) error
Kill deletes the sandbox.
func (*SandboxHandle) Logs ¶
func (s *SandboxHandle) Logs(ctx context.Context, params *control.SandboxLogsParams) (*control.SandboxLogsResponse, error)
func (*SandboxHandle) Refresh ¶
func (s *SandboxHandle) Refresh(ctx context.Context, req *control.RefreshSandboxRequest) error
func (*SandboxHandle) Reload ¶
func (s *SandboxHandle) Reload(ctx context.Context) (*SandboxDetail, error)
func (*SandboxHandle) Resume ¶
func (s *SandboxHandle) Resume(ctx context.Context) (*Sandbox, error)
Resume reconnects to a paused sandbox handle and returns a running sandbox handle without changing its configured lifetime.
func (*SandboxHandle) SetTimeout ¶
func (s *SandboxHandle) SetTimeout(ctx context.Context, req *control.TimeoutRequest) error
type Template ¶
type Template struct {
// contains filtered or unexported fields
}
func NewTemplate ¶
func NewTemplate() *Template
NewTemplate creates a high-level template builder with E2B-style helpers.
func (*Template) AptInstall ¶
func (t *Template) AptInstall(packages []string, opts *TemplateAptInstallOptions) *Template
func (*Template) BunInstall ¶
func (t *Template) BunInstall(packages []string, opts *TemplateBunInstallOptions) *Template
func (*Template) Copy ¶
func (t *Template) Copy(src, dest string, opts *TemplateCopyOptions) *Template
Copy adds one local source to the template build context.
func (*Template) CopyItems ¶
func (t *Template) CopyItems(items []TemplateCopyItem) *Template
CopyItems adds multiple local sources with per-item copy options.
func (*Template) FromAWSRegistry ¶
func (*Template) FromBaseImage ¶
func (*Template) FromBunImage ¶
func (*Template) FromDebianImage ¶
func (*Template) FromDockerfile ¶
FromDockerfile parses a supported Dockerfile subset into template build steps.
func (*Template) FromGCPRegistry ¶
func (*Template) FromNodeImage ¶
func (*Template) FromPythonImage ¶
func (*Template) FromTemplate ¶
func (*Template) FromUbuntuImage ¶
func (*Template) GitClone ¶
func (t *Template) GitClone(repoURL, path string, opts *TemplateGitCloneOptions) *Template
func (*Template) MakeDir ¶
func (t *Template) MakeDir(paths []string, opts *TemplateMakeDirOptions) *Template
func (*Template) MakeSymlink ¶
func (t *Template) MakeSymlink(src, dest string, opts *TemplateMakeSymlinkOptions) *Template
func (*Template) NpmInstall ¶
func (t *Template) NpmInstall(packages []string, opts *TemplateNpmInstallOptions) *Template
func (*Template) PipInstall ¶
func (t *Template) PipInstall(packages []string, opts *TemplatePipInstallOptions) *Template
func (*Template) Remove ¶
func (t *Template) Remove(paths []string, opts *TemplateRemoveOptions) *Template
func (*Template) Rename ¶
func (t *Template) Rename(src, dest string, opts *TemplateRenameOptions) *Template
func (*Template) Request ¶
func (t *Template) Request() *build.BuildRequest
func (*Template) RunCmd ¶
func (t *Template) RunCmd(command string, opts *TemplateCommandOptions) *Template
RunCmd adds one RUN step and optionally wraps it to execute as a specific user.
func (*Template) RunCmds ¶
func (t *Template) RunCmds(commands []string, opts *TemplateCommandOptions) *Template
RunCmds adds multiple RUN steps using the same options.
func (*Template) SetReadyCmd ¶
func (*Template) SetStartCmd ¶
SetStartCmd records the start command and ready command for the built template.
func (*Template) SetWorkdir ¶
type TemplateBuildInfo ¶
type TemplateBuildInfo struct {
TemplateID string
BuildID string
Name string
Tags []string
Status string
Template *build.TemplateResponse
Build *build.BuildResponse
}
type TemplateBuildOptions ¶
type TemplateBuildOptions struct {
GatewayConfig
Tags []string
BaseTemplateID string
Visibility string
Envs map[string]string
// Deprecated: public template creation rejects physical volume mounts.
// Derive from an approved base template and use WorkspaceMounts for logical
// Workspace views instead. Retained for source compatibility.
VolumeMounts []build.TemplateVolumeMount
// WorkspaceMounts are template defaults used only when CreateOptions has a
// WorkspaceID and omits explicit WorkspaceMounts. They expose logical
// container paths only; physical NFS details stay control-plane owned.
WorkspaceMounts []build.TemplateWorkspaceMount
// Workdir is the runtime working directory for Sandboxes created from this
// template. It is the root allowed by Files(). To set the image build
// WORKDIR for template steps, use Template.SetWorkdir instead.
Workdir string
CPUCount *int32
MemoryMB *int32
Wait *bool
WaitTimeout time.Duration
PollInterval time.Duration
OnBuildLog func(LogEntry)
}
type TemplateBuildStatusOptions ¶
type TemplateBuildStatusOptions struct {
GatewayConfig
LogsOffset *int
Limit *int
Level string
}
type TemplateCommandOptions ¶
TemplateCommandOptions configures template RUN helper commands.
type TemplateCopyItem ¶
type TemplateCopyItem struct {
Src string
Srcs []string
Dest string
FilesHash string
ForceUpload bool
Mode *int
ResolveSymlinks bool
}
TemplateCopyItem describes one COPY helper entry with per-item options.
type TemplateCopyOptions ¶
type TemplateCopyOptions struct {
FilesHash string
ForceUpload bool
Mode *int
ResolveSymlinks bool
}
TemplateCopyOptions configures local sources copied into a template build.
type TemplateGetOptions ¶
type TemplateGetOptions struct {
GatewayConfig
Limit int
NextToken string
}
type TemplateGitCloneOptions ¶
type TemplateListOptions ¶
type TemplateListOptions struct {
GatewayConfig
Visibility string
TeamID string
Limit int
Offset int
}
type TemplateMakeDirOptions ¶
type TemplateMakeDirOptions struct {
TemplatePathOptions
Mode *int
}
type TemplateMakeSymlinkOptions ¶
type TemplateMakeSymlinkOptions struct {
TemplatePathOptions
}
type TemplatePathOptions ¶
type TemplateRemoveOptions ¶
type TemplateRemoveOptions struct {
TemplatePathOptions
Recursive bool
}
type TemplateRenameOptions ¶
type TemplateRenameOptions struct {
TemplatePathOptions
}
type Workspace ¶ added in v0.1.4
Workspace is a server-owned persistent NFS directory. Attach it to a Sandbox with CreateOptions.WorkspaceID; physical storage paths never cross the public SDK boundary.
type WorkspaceMount ¶ added in v0.2.0
type WorkspaceMount = control.WorkspaceMount
WorkspaceMount is a logical view of the one Workspace selected by CreateOptions.WorkspaceID. It cannot configure physical NFS storage.
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
build_nfs_codex_template
command
Build an NFS-backed sandbox that runs Codex through nano-executor.
|
Build an NFS-backed sandbox that runs Codex through nano-executor. |
|
build_nfs_web_template
command
|
|
|
build_template
command
|
|
|
cmd_smoke
command
|
|
|
control_sandbox
command
|
|
|
full_workflow
command
|
|
|
nfs_sandbox_lifecycle
command
NFS Sandbox lifecycle example: use the legacy Sandbox-scoped NFS directory without creating a reusable Workspace.
|
NFS Sandbox lifecycle example: use the legacy Sandbox-scoped NFS directory without creating a reusable Workspace. |
|
template_features
command
|
|
|
workspace_lifecycle
command
Workspace lifecycle example: create, attach, pause, resume, replace, and clean up a persistent NFS directory without exposing its physical storage path.
|
Workspace lifecycle example: create, attach, pause, resume, replace, and clean up a persistent NFS directory without exposing its physical storage path. |