Versions in this module Expand all Collapse all v0 v0.2.0 Jul 25, 2026 Changes in this version + const CodeVolumeHostMismatch + const CodeVolumeInUse + const CodeVolumeNameTaken + const CodeVolumeNotFound + const CodeVolumesAttached + const VolumeStatusAttached + const VolumeStatusAttaching + const VolumeStatusDeleting + const VolumeStatusDetached + func IsVolumeInUse(err error) bool type Client + func (c *Client) CreateVolume(ctx context.Context, params CreateVolumeParams) (*Volume, error) + func (c *Client) DeleteVolume(ctx context.Context, ref string) error + func (c *Client) GetVolume(ctx context.Context, ref string) (*Volume, error) + func (c *Client) ListVolumes(ctx context.Context) ([]*Volume, error) type CreateCapsuleParams + VolumeIDs []string + type CreateVolumeParams struct + Name string + Size string + SizeMB int32 + type Volume struct + CapsuleID *string + CreatedAt string + HostID *string + ID string + LastAttachedAt *string + MountPath string + Name string + SizeMB int32 + Status string + TeamID string v0.1.0 Jul 20, 2026 Changes in this version + const CodeAuthSessionRequired + const CodeConflict + const CodeForbidden + const CodeHostUnreachable + const CodeInternal + const CodeInvalidRequest + const CodeNotFound + const CodePayloadTooLarge + const CodeSandboxNotFound + const CodeSandboxNotRunning + const CodeTemplateNotFound + const CodeTemplateProtected + const CodeUnauthorized + const CodeValidationFailed + const DefaultBaseURL + const DefaultProxyDomain + const StatusError + const StatusHibernated + const StatusMissing + const StatusPaused + const StatusPausing + const StatusPending + const StatusResuming + const StatusRunning + const StatusSnapshotting + const StatusStarting + const StatusStopped + const StatusStopping + const Version + func IsConflict(err error) bool + func IsGitAuthError(err error) bool + func IsNotFound(err error) bool + func IsNotRunning(err error) bool + func IsUnauthorized(err error) bool + type APIError struct + Code string + Details map[string]any + Message string + RequestID string + Retryable bool + StatusCode int + func (e *APIError) Error() string + type BackgroundProcess struct + Cmd string + PID uint32 + Tag string + type Capsule struct + CreatedAt string + DiskSizeMB int32 + DiskUsedMB *int64 + ID string + LastActiveAt *string + LastUpdated string + MemoryMB int32 + Metadata map[string]string + StartedAt *string + Status string + Template string + TimeoutSec int32 + VCPUs int32 + func (cap *Capsule) AttachProcess(ctx context.Context, selector string) (<-chan StreamEvent, error) + func (cap *Capsule) Destroy(ctx context.Context) error + func (cap *Capsule) Exec(ctx context.Context, params ExecParams) (*ExecResult, error) + func (cap *Capsule) ExecStream(ctx context.Context, params ExecStreamParams) (<-chan StreamEvent, error) + func (cap *Capsule) Exists(ctx context.Context, p string) (bool, error) + func (cap *Capsule) Git() *Git + func (cap *Capsule) KillProcess(ctx context.Context, selector string, sig Signal) error + func (cap *Capsule) ListDir(ctx context.Context, path string, depth uint32) ([]FileEntry, error) + func (cap *Capsule) ListProcesses(ctx context.Context) ([]Process, error) + func (cap *Capsule) MakeDir(ctx context.Context, path string) (*FileEntry, error) + func (cap *Capsule) Metrics(ctx context.Context, rangeTier string) (*Metrics, error) + func (cap *Capsule) Pause(ctx context.Context) error + func (cap *Capsule) Ping(ctx context.Context) error + func (cap *Capsule) Pty(ctx context.Context, params PtyParams) (*PtySession, error) + func (cap *Capsule) PtyConnect(ctx context.Context, tag string) (*PtySession, error) + func (cap *Capsule) ReadFile(ctx context.Context, path string) ([]byte, error) + func (cap *Capsule) ReadFileStream(ctx context.Context, path string) (io.ReadCloser, error) + func (cap *Capsule) Refresh(ctx context.Context) error + func (cap *Capsule) Remove(ctx context.Context, path string) error + func (cap *Capsule) Resume(ctx context.Context) error + func (cap *Capsule) StartBackground(ctx context.Context, params StartBackgroundParams) (*BackgroundProcess, error) + func (cap *Capsule) URL(port int) string + func (cap *Capsule) WaitForStatus(ctx context.Context, target string) error + func (cap *Capsule) WriteFile(ctx context.Context, path string, content []byte) error + func (cap *Capsule) WriteFileFrom(ctx context.Context, path string, r io.Reader) error + type Client struct + func New(opts ...Option) (*Client, error) + func (c *Client) AuthorizedRequest(ctx context.Context, method, absURL string, body io.Reader) (*http.Request, error) + func (c *Client) Capsule(id string) *Capsule + func (c *Client) CreateCapsule(ctx context.Context, params CreateCapsuleParams) (*Capsule, error) + func (c *Client) CreateSnapshot(ctx context.Context, capsuleID, name string) (*Capsule, error) + func (c *Client) DeleteSnapshot(ctx context.Context, name string) error + func (c *Client) DialProxyWS(ctx context.Context, absURL string) (*websocket.Conn, error) + func (c *Client) DialWS(ctx context.Context, absURL string) (*websocket.Conn, error) + func (c *Client) GetCapsule(ctx context.Context, id string) (*Capsule, error) + func (c *Client) HTTPClient() *http.Client + func (c *Client) ListCapsules(ctx context.Context) ([]*Capsule, error) + func (c *Client) ListSnapshots(ctx context.Context, params ListSnapshotsParams) (*SnapshotList, error) + func (c *Client) ProxyRequest(ctx context.Context, method, absURL string, body io.Reader) (*http.Request, error) + func (c *Client) ProxyURL(capsuleID string, port int, websocket bool) string + func (c *Client) RenameSnapshot(ctx context.Context, name, newName string) error + func (c *Client) SetSnapshotVisibility(ctx context.Context, name string, public bool) error + func (c *Client) Stats(ctx context.Context, rangeParam string) (*Stats, error) + func (c *Client) Usage(ctx context.Context, from, to string) (*Usage, error) + type CreateCapsuleParams struct + MemoryMB int32 + Metadata map[string]string + Template string + TimeoutSec int32 + VCPUs int32 + type ExecParams struct + Args []string + Cmd string + Cwd string + Envs map[string]string + TimeoutSec int32 + type ExecResult struct + Cmd string + DurationMs int64 + ExitCode int32 + Stderr []byte + Stdout []byte + type ExecStreamParams struct + Args []string + Cmd string + type FileEntry struct + Group string + Mode uint32 + ModifiedAt int64 + Name string + Owner string + Path string + Permissions string + Size int64 + SymlinkTarget *string + Type string + type FileStatus struct + IndexStatus string + Path string + RenamedFrom string + WorkTreeStatus string + func (f FileStatus) Staged() bool + func (f FileStatus) Status() string + type Git struct + func (g *Git) Add(ctx context.Context, p GitAddParams) (*ExecResult, error) + func (g *Git) Branches(ctx context.Context, opts GitOptions) ([]GitBranch, error) + func (g *Git) CheckoutBranch(ctx context.Context, name string, opts GitOptions) (*ExecResult, error) + func (g *Git) Clone(ctx context.Context, p GitCloneParams) (*ExecResult, error) + func (g *Git) Commit(ctx context.Context, message string, p GitCommitParams) (*ExecResult, error) + func (g *Git) ConfigureUser(ctx context.Context, name, email string, p GitConfigParams) error + func (g *Git) CreateBranch(ctx context.Context, name string, p GitCreateBranchParams) (*ExecResult, error) + func (g *Git) CreateTag(ctx context.Context, name string, p GitTagParams) (*ExecResult, error) + func (g *Git) CurrentBranch(ctx context.Context, opts GitOptions) (string, error) + func (g *Git) DangerouslyAuthenticate(ctx context.Context, p GitAuthenticateParams) error + func (g *Git) DeleteBranch(ctx context.Context, name string, p GitDeleteBranchParams) (*ExecResult, error) + func (g *Git) DeleteTag(ctx context.Context, name string, opts GitOptions) (*ExecResult, error) + func (g *Git) Diff(ctx context.Context, p GitDiffParams) (string, error) + func (g *Git) Fetch(ctx context.Context, p GitFetchParams) (*ExecResult, error) + func (g *Git) GetConfig(ctx context.Context, key string, p GitConfigParams) (string, error) + func (g *Git) Init(ctx context.Context, p GitInitParams) (*ExecResult, error) + func (g *Git) Log(ctx context.Context, p GitLogParams) ([]GitCommit, error) + func (g *Git) Merge(ctx context.Context, p GitMergeParams) (*ExecResult, error) + func (g *Git) Pull(ctx context.Context, p GitPullParams) (*ExecResult, error) + func (g *Git) Push(ctx context.Context, p GitPushParams) (*ExecResult, error) + func (g *Git) RemoteAdd(ctx context.Context, name, remoteURL string, p GitRemoteAddParams) (*ExecResult, error) + func (g *Git) RemoteGet(ctx context.Context, name string, opts GitOptions) (string, error) + func (g *Git) Reset(ctx context.Context, p GitResetParams) (*ExecResult, error) + func (g *Git) Restore(ctx context.Context, paths []string, p GitRestoreParams) (*ExecResult, error) + func (g *Git) SetConfig(ctx context.Context, key, value string, p GitConfigParams) (*ExecResult, error) + func (g *Git) Show(ctx context.Context, object string, p GitShowParams) (string, error) + func (g *Git) StashList(ctx context.Context, opts GitOptions) ([]GitStashEntry, error) + func (g *Git) StashPop(ctx context.Context, p GitStashPopParams) (*ExecResult, error) + func (g *Git) StashSave(ctx context.Context, p GitStashSaveParams) (*ExecResult, error) + func (g *Git) Status(ctx context.Context, opts GitOptions) (*GitStatus, error) + func (g *Git) Tags(ctx context.Context, opts GitOptions) ([]string, error) + type GitAddParams struct + All bool + Paths []string + type GitAuthenticateParams struct + Host string + Password string + Protocol string + Username string + type GitBranch struct + IsCurrent bool + Name string + type GitCloneParams struct + Branch string + DangerouslyStoreCredentials bool + Depth int + Dest string + Password string + SingleBranch bool + URL string + Username string + type GitCommit struct + AuthorEmail string + AuthorName string + Body string + Date string + Hash string + ShortHash string + Subject string + type GitCommitParams struct + AllowEmpty bool + AuthorEmail string + AuthorName string + type GitConfigParams struct + Scope string + type GitCreateBranchParams struct + StartPoint string + type GitDeleteBranchParams struct + Force bool + type GitDiffParams struct + NameOnly bool + Paths []string + Refs []string + Staged bool + Stat bool + type GitError struct + Auth bool + ExitCode int32 + Message string + Op string + Stderr string + func (e *GitError) Error() string + type GitFetchParams struct + All bool + Depth int + Password string + Prune bool + Refspec string + Remote string + Tags bool + Username string + type GitInitParams struct + Bare bool + InitialBranch string + Path string + type GitLogParams struct + Author string + MaxCount int + Paths []string + Ref string + Since string + Skip int + Until string + type GitMergeParams struct + Abort bool + FFOnly bool + Message string + NoFF bool + Ref string + Squash bool + type GitOptions struct + Cwd string + Envs map[string]string + TimeoutSec int32 + type GitPullParams struct + Branch string + FFOnly bool + Password string + Rebase bool + Remote string + Username string + type GitPushParams struct + Branch string + Force bool + Password string + Remote string + SetUpstream bool + Username string + type GitRemoteAddParams struct + Fetch bool + type GitResetParams struct + Mode string + Paths []string + Ref string + type GitRestoreParams struct + Source string + Staged bool + Worktree bool + type GitShowParams struct + NameOnly bool + Stat bool + type GitStashEntry struct + Description string + Ref string + type GitStashPopParams struct + Ref string + type GitStashSaveParams struct + IncludeUntracked bool + KeepIndex bool + Message string + type GitStatus struct + Ahead int + Behind int + Branch string + Detached bool + Files []FileStatus + Upstream string + func (s GitStatus) HasConflicts() bool + func (s GitStatus) HasStaged() bool + func (s GitStatus) HasUntracked() bool + func (s GitStatus) IsClean() bool + type GitTagParams struct + Force bool + Message string + Ref string + type ListSnapshotsParams struct + Page int + PerPage int + Query string + Type string + type MetricPoint struct + CPUPct float64 + DiskBytes int64 + MemBytes int64 + TimestampUnix int64 + type Metrics struct + CapsuleID string + Points []MetricPoint + Range string + type Option func(*Client) + func WithAPIKey(key string) Option + func WithBaseURL(raw string) Option + func WithHTTPClient(hc *http.Client) Option + func WithProxyDomain(domain string) Option + func WithUserAgent(ua string) Option + type Process struct + Args []string + Cmd string + PID uint32 + Tag string + type PtyEvent struct + Data []byte + ExitCode int32 + Fatal bool + PID uint32 + Tag string + Type PtyEventType + type PtyEventType string + const PtyEventError + const PtyEventExit + const PtyEventOutput + const PtyEventStarted + type PtyParams struct + Args []string + Cmd string + Cols uint32 + Cwd string + Envs map[string]string + Rows uint32 + User string + type PtySession struct + func (s *PtySession) Close() error + func (s *PtySession) Events() <-chan PtyEvent + func (s *PtySession) Kill() error + func (s *PtySession) PID() uint32 + func (s *PtySession) Resize(cols, rows uint32) error + func (s *PtySession) Tag() string + func (s *PtySession) Write(p []byte) error + type Signal string + const SignalKill + const SignalTerm + type Snapshot struct + CreatedAt string + MemoryMB *int32 + Metadata map[string]string + Name string + Owned bool + Platform bool + Protected bool + Public bool + SizeBytes int64 + TeamSlug string + Type string + VCPUs *int32 + type SnapshotList struct + Page int + PerPage int + Templates []Snapshot + Total int + TotalPages int + type StartBackgroundParams struct + Args []string + Cmd string + Cwd string + Envs map[string]string + Tag string + type Stats struct + Current StatsCurrent + Peaks StatsPeaks + Range string + Series StatsSeries + type StatsCurrent struct + MemoryMBReserved int32 + RunningCount int32 + VCPUsReserved int32 + type StatsPeaks struct + MemoryMB int32 + RunningCount int32 + VCPUs int32 + type StatsSeries struct + Labels []string + MemoryMB []int32 + Running []int32 + VCPUs []int32 + type StreamEvent struct + Data string + ExitCode int32 + PID uint32 + Type StreamEventType + type StreamEventType string + const EventError + const EventExit + const EventStart + const EventStderr + const EventStdout + type Usage struct + From string + Points []UsagePoint + To string + type UsagePoint struct + CPUMinutes float64 + Date string + RAMMBMinutes float64