Documentation
¶
Overview ¶
Package e2b is an unofficial Go SDK for E2B sandboxes (https://e2b.dev).
A Client authenticates against the E2B control plane and creates Sandboxes. Each Sandbox exposes file and process operations backed by envd (the agent that runs inside every E2B microVM), over ConnectRPC.
Example ¶
c := e2b.NewClient("E2B_API_KEY")
sb, err := c.CreateSandbox(ctx, e2b.CreateRequest{
TemplateID: "base",
Timeout: 5 * time.Minute,
})
if err != nil {
return err
}
defer sb.Destroy(ctx)
_, err = sb.WriteFile(ctx, "/workspace/hello.txt", []byte("hi"))
if err != nil {
return err
}
result, err := sb.Exec(ctx, e2b.ExecRequest{
Command: []string{"cat", "/workspace/hello.txt"},
})
// result.Stdout == "hi"
This SDK is not affiliated with or endorsed by E2B. See https://github.com/e2b-dev/E2B/issues/985 for upstream status.
Index ¶
- Variables
- type Client
- func (c *Client) ConnectSandbox(ctx context.Context, request ConnectSandboxRequest) (*Sandbox, error)
- func (c *Client) ConnectVolume(ctx context.Context, volumeID string) (*Volume, error)
- func (c *Client) CreateSandbox(ctx context.Context, request CreateRequest) (*Sandbox, error)
- func (c *Client) CreateVolume(ctx context.Context, name string) (*Volume, error)
- func (c *Client) DeleteSnapshot(ctx context.Context, snapshotID string) (bool, error)
- func (c *Client) DestroyVolume(ctx context.Context, volumeID string) (bool, error)
- func (c *Client) EnvdURL(sandboxID string) string
- func (c *Client) GetSandboxInfo(ctx context.Context, sandboxID string) (SandboxInfo, error)
- func (c *Client) GetVolumeInfo(ctx context.Context, volumeID string) (VolumeAndToken, error)
- func (c *Client) ListSandboxes(ctx context.Context, request ListSandboxesRequest) (ListSandboxesResponse, error)
- func (c *Client) ListSnapshots(ctx context.Context, request ListSnapshotsRequest) (ListSnapshotsResponse, error)
- func (c *Client) ListVolumes(ctx context.Context) ([]VolumeInfo, error)
- type CommandConnectOptions
- type CommandHandle
- func (h *CommandHandle) CloseStdin(ctx context.Context) error
- func (h *CommandHandle) Disconnect()
- func (h *CommandHandle) Kill(ctx context.Context) (bool, error)
- func (h *CommandHandle) PID() uint32
- func (h *CommandHandle) PTYOutput() []byte
- func (h *CommandHandle) ResizePTY(ctx context.Context, cols uint32, rows uint32) error
- func (h *CommandHandle) SendPTY(ctx context.Context, data []byte) error
- func (h *CommandHandle) SendStdin(ctx context.Context, data []byte) error
- func (h *CommandHandle) Stderr() string
- func (h *CommandHandle) Stdout() string
- func (h *CommandHandle) Wait() (CommandResult, error)
- type CommandResult
- type CommandStartRequest
- type Config
- type ConnectSandboxRequest
- type CreateRequest
- type CreateSnapshotRequest
- type EntryInfo
- type ExecRequest
- type ExecResult
- type FileInfo
- type FilesystemEntryType
- type FilesystemEvent
- type FilesystemEventType
- type ListSandboxesRequest
- type ListSandboxesResponse
- type ListSnapshotsRequest
- type ListSnapshotsResponse
- type PTYConnectOptions
- type PTYStartRequest
- type ProcessInfo
- type Sandbox
- func (s *Sandbox) CloseStdin(ctx context.Context, pid uint32) error
- func (s *Sandbox) Connect(ctx context.Context, timeout time.Duration) error
- func (s *Sandbox) ConnectPTY(ctx context.Context, pid uint32, options PTYConnectOptions) (*CommandHandle, error)
- func (s *Sandbox) ConnectProcess(ctx context.Context, pid uint32, options CommandConnectOptions) (*CommandHandle, error)
- func (s *Sandbox) CreatePTY(ctx context.Context, request PTYStartRequest) (*CommandHandle, error)
- func (s *Sandbox) CreateSnapshot(ctx context.Context, request CreateSnapshotRequest) (SnapshotInfo, error)
- func (s *Sandbox) Destroy(ctx context.Context) error
- func (s *Sandbox) EnvdURL() string
- func (s *Sandbox) Exec(ctx context.Context, request ExecRequest) (ExecResult, error)
- func (s *Sandbox) Exists(ctx context.Context, path string) (bool, error)
- func (s *Sandbox) GetHost(port int) string
- func (s *Sandbox) GetInfo(ctx context.Context) (SandboxInfo, error)
- func (s *Sandbox) GetMetrics(ctx context.Context, request SandboxMetricsRequest) ([]SandboxMetric, error)
- func (s *Sandbox) ID() string
- func (s *Sandbox) Kill(ctx context.Context) error
- func (s *Sandbox) KillPTY(ctx context.Context, pid uint32) (bool, error)
- func (s *Sandbox) KillProcess(ctx context.Context, pid uint32) (bool, error)
- func (s *Sandbox) ListDir(ctx context.Context, path string, depth uint32) ([]EntryInfo, error)
- func (s *Sandbox) ListFiles(ctx context.Context, prefix string) ([]FileInfo, error)
- func (s *Sandbox) ListProcesses(ctx context.Context) ([]ProcessInfo, error)
- func (s *Sandbox) ListSnapshots(ctx context.Context, request ListSnapshotsRequest) (ListSnapshotsResponse, error)
- func (s *Sandbox) MakeDir(ctx context.Context, path string) (bool, error)
- func (s *Sandbox) Pause(ctx context.Context) (bool, error)
- func (s *Sandbox) ReadFile(ctx context.Context, path string) ([]byte, error)
- func (s *Sandbox) Remove(ctx context.Context, path string) error
- func (s *Sandbox) Rename(ctx context.Context, oldPath string, newPath string) (EntryInfo, error)
- func (s *Sandbox) ResizePTY(ctx context.Context, pid uint32, cols uint32, rows uint32) error
- func (s *Sandbox) SendPTYInput(ctx context.Context, pid uint32, data []byte) error
- func (s *Sandbox) SendStdin(ctx context.Context, pid uint32, data []byte) error
- func (s *Sandbox) SetTimeout(ctx context.Context, timeout time.Duration) error
- func (s *Sandbox) StartCommand(ctx context.Context, request CommandStartRequest) (*CommandHandle, error)
- func (s *Sandbox) Stat(ctx context.Context, path string) (EntryInfo, error)
- func (s *Sandbox) TemplateID() string
- func (s *Sandbox) WatchDir(ctx context.Context, path string, options WatchOptions, ...) (*WatchHandle, error)
- func (s *Sandbox) WriteFile(ctx context.Context, path string, content []byte) error
- type SandboxInfo
- type SandboxLifecycle
- type SandboxMetric
- type SandboxMetricsRequest
- type SandboxNetwork
- type SandboxState
- type SandboxVolumeMount
- type SnapshotInfo
- type Volume
- func (v *Volume) Destroy(ctx context.Context) (bool, error)
- func (v *Volume) Exists(ctx context.Context, path string) (bool, error)
- func (v *Volume) ID() string
- func (v *Volume) List(ctx context.Context, path string, depth uint32) ([]VolumeEntryInfo, error)
- func (v *Volume) MakeDir(ctx context.Context, path string, options VolumeWriteOptions) (VolumeEntryInfo, error)
- func (v *Volume) Name() string
- func (v *Volume) ReadFile(ctx context.Context, path string) ([]byte, error)
- func (v *Volume) Remove(ctx context.Context, path string) error
- func (v *Volume) Stat(ctx context.Context, path string) (VolumeEntryInfo, error)
- func (v *Volume) UpdateMetadata(ctx context.Context, path string, options VolumeMetadataOptions) (VolumeEntryInfo, error)
- func (v *Volume) WriteFile(ctx context.Context, path string, content []byte, options VolumeWriteOptions) (VolumeEntryInfo, error)
- type VolumeAndToken
- type VolumeEntryInfo
- type VolumeEntryType
- type VolumeInfo
- type VolumeMetadataOptions
- type VolumeWriteOptions
- type WatchHandle
- type WatchOptions
Constants ¶
This section is empty.
Variables ¶
var ( // ErrSandboxNotFound indicates the sandbox ID is unknown to the control // plane — typically because it has already been destroyed or timed out. ErrSandboxNotFound = errors.New("e2b: sandbox not found") // ErrFileNotFound is returned by file operations when the target path // does not exist in the sandbox. ErrFileNotFound = errors.New("e2b: file not found") // ErrSandboxDestroyed is returned by any operation on a Sandbox whose // Destroy has already been called. ErrSandboxDestroyed = errors.New("e2b: sandbox is destroyed") // ErrVolumeNotFound indicates the volume ID is unknown to the control // plane. ErrVolumeNotFound = errors.New("e2b: volume not found") )
Sentinel errors returned by this package. Callers should branch on them with errors.Is.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an authenticated handle to the E2B control plane. Safe for concurrent use.
func NewClient ¶
NewClient constructs a Client with just an API key. For more control (custom timeout, staging host), use NewClientWithConfig.
func NewClientWithConfig ¶
NewClientWithConfig constructs a Client from a fully-specified Config.
func (*Client) ConnectSandbox ¶
func (*Client) ConnectVolume ¶
ConnectVolume loads an existing volume and returns a handle to its content API.
func (*Client) CreateSandbox ¶
CreateSandbox provisions a new sandbox from the given template and returns a handle for interacting with it. Callers are responsible for calling Destroy to release the sandbox.
AdditionalPackages, when non-empty, are installed via apt-get inside the sandbox before the call returns. Install failures cause the sandbox to be destroyed and the error propagated.
func (*Client) CreateVolume ¶
CreateVolume creates a new persistent volume.
func (*Client) DeleteSnapshot ¶
func (*Client) DestroyVolume ¶
DestroyVolume deletes a volume. It returns false when the volume is already gone.
func (*Client) EnvdURL ¶
EnvdURL returns the envd base URL for a given sandbox ID. Useful for debugging or direct gRPC-Web inspection. The sandbox must exist; otherwise the URL will 404.
func (*Client) GetSandboxInfo ¶
func (*Client) GetVolumeInfo ¶
GetVolumeInfo loads a volume and its content token.
func (*Client) ListSandboxes ¶
func (c *Client) ListSandboxes(ctx context.Context, request ListSandboxesRequest) (ListSandboxesResponse, error)
func (*Client) ListSnapshots ¶
func (c *Client) ListSnapshots(ctx context.Context, request ListSnapshotsRequest) (ListSnapshotsResponse, error)
func (*Client) ListVolumes ¶
func (c *Client) ListVolumes(ctx context.Context) ([]VolumeInfo, error)
ListVolumes returns all team volumes.
type CommandConnectOptions ¶
CommandConnectOptions controls command stream callbacks.
type CommandHandle ¶
type CommandHandle struct {
// contains filtered or unexported fields
}
CommandHandle tracks a running command or PTY session.
func (*CommandHandle) CloseStdin ¶
func (h *CommandHandle) CloseStdin(ctx context.Context) error
CloseStdin closes stdin, signaling EOF to the process.
func (*CommandHandle) Disconnect ¶
func (h *CommandHandle) Disconnect()
Disconnect stops receiving stream events without killing the process.
func (*CommandHandle) Kill ¶
func (h *CommandHandle) Kill(ctx context.Context) (bool, error)
Kill sends SIGKILL to the process.
func (*CommandHandle) PTYOutput ¶
func (h *CommandHandle) PTYOutput() []byte
PTYOutput returns the PTY bytes captured so far.
func (*CommandHandle) SendPTY ¶
func (h *CommandHandle) SendPTY(ctx context.Context, data []byte) error
SendPTY writes bytes to a PTY session.
func (*CommandHandle) SendStdin ¶
func (h *CommandHandle) SendStdin(ctx context.Context, data []byte) error
SendStdin writes to a command's stdin stream.
func (*CommandHandle) Stderr ¶
func (h *CommandHandle) Stderr() string
Stderr returns the stderr captured so far.
func (*CommandHandle) Stdout ¶
func (h *CommandHandle) Stdout() string
Stdout returns the stdout captured so far.
func (*CommandHandle) Wait ¶
func (h *CommandHandle) Wait() (CommandResult, error)
Wait blocks until the process stream ends and returns the final result.
type CommandResult ¶
type CommandResult struct {
ExitCode int
Stdout string
Stderr string
PTYOutput []byte
Metadata map[string]string
}
CommandResult is returned by CommandHandle.Wait.
type CommandStartRequest ¶
type CommandStartRequest struct {
Command []string
WorkingDirectory string
Environment map[string]string
Tag string
Stdin bool
OnStdout func(string)
OnStderr func(string)
}
CommandStartRequest starts a background command.
type Config ¶
type Config struct {
// APIKey authenticates all control-plane calls. Required.
APIKey string
// APIBaseURL overrides the control-plane host. Defaults to
// https://api.e2b.app when empty.
APIBaseURL string
// RequestTimeout bounds every HTTP call to the control plane.
// Defaults to 30s when zero.
RequestTimeout time.Duration
}
Config carries connection settings for a Client. Zero values fall back to sensible defaults (production API, 30s HTTP timeout).
type ConnectSandboxRequest ¶
type ConnectSandboxRequest struct {
SandboxID string
Timeout time.Duration
AllowShellFallback bool
}
ConnectSandboxRequest reconnects to an existing sandbox, resuming it if needed.
type CreateRequest ¶
type CreateRequest struct {
// TemplateID is the E2B template the sandbox is cloned from. Required.
TemplateID string
// Timeout bounds the lifetime of the sandbox. If zero, the E2B server's
// default applies.
Timeout time.Duration
// Metadata is attached to the sandbox on creation and is visible on
// the control plane. Commonly used for user / project / trace IDs.
Metadata map[string]string
// EnvVars are injected into every process started in the sandbox.
EnvVars map[string]string
// AllowInternetAccess controls whether the sandbox can reach the public
// internet. Default is false (network-isolated).
AllowInternetAccess bool
// NetworkAllowlist is an egress allowlist of CIDRs / hostnames. Only
// honored when AllowInternetAccess is false — the listed destinations
// remain reachable.
NetworkAllowlist []string
// AdditionalPackages are installed via apt-get at sandbox start. Useful
// for one-off extensions of a base template without rebuilding it.
AdditionalPackages []string
// AllowShellFallback enables shell-based fallbacks (cat, find) when
// envd ConnectRPC calls fail. Useful for older envd versions or envd
// bugs; default false.
AllowShellFallback bool
}
CreateRequest configures a new sandbox. TemplateID is required; all other fields are optional.
type CreateSnapshotRequest ¶
type CreateSnapshotRequest struct {
Name string
}
CreateSnapshotRequest controls snapshot creation.
type EntryInfo ¶
type EntryInfo struct {
Name string
Type FilesystemEntryType
Path string
Size int64
Mode uint32
Permissions string
Owner string
Group string
ModifiedTime time.Time
SymlinkTarget string
}
EntryInfo describes a filesystem object inside the sandbox.
type ExecRequest ¶
type ExecRequest struct {
// Command is an argv slice. Command[0] is the executable; the rest are
// positional arguments.
Command []string
// WorkingDirectory sets the cwd. Empty means the sandbox default.
WorkingDirectory string
// Environment merges with the sandbox-level EnvVars for this call.
Environment map[string]string
// Timeout bounds the call. Zero means no deadline beyond the parent ctx.
Timeout time.Duration
}
ExecRequest describes a command to run inside a sandbox.
type ExecResult ¶
type ExecResult struct {
ExitCode int
Stdout string
Stderr string
// Metadata carries envd-provided diagnostics (e.g. an "error" key when
// the process itself reported a launch failure).
Metadata map[string]string
}
ExecResult is returned by Sandbox.Exec after the process has finished.
type FilesystemEntryType ¶
type FilesystemEntryType string
FilesystemEntryType describes the kind of object returned by filesystem RPCs.
const ( FilesystemEntryTypeUnknown FilesystemEntryType = "unknown" FilesystemEntryTypeFile FilesystemEntryType = "file" FilesystemEntryTypeDirectory FilesystemEntryType = "directory" FilesystemEntryTypeSymlink FilesystemEntryType = "symlink" )
type FilesystemEvent ¶
type FilesystemEvent struct {
Name string
Type FilesystemEventType
}
FilesystemEvent is delivered to directory watch callbacks.
type FilesystemEventType ¶
type FilesystemEventType string
FilesystemEventType is emitted by directory watches.
const ( FilesystemEventTypeCreate FilesystemEventType = "create" FilesystemEventTypeWrite FilesystemEventType = "write" FilesystemEventTypeRemove FilesystemEventType = "remove" FilesystemEventTypeRename FilesystemEventType = "rename" FilesystemEventTypeChmod FilesystemEventType = "chmod" )
type ListSandboxesRequest ¶
type ListSandboxesRequest struct {
Metadata map[string]string
States []SandboxState
Limit int
NextToken string
}
ListSandboxesRequest filters and paginates sandbox listing.
type ListSandboxesResponse ¶
type ListSandboxesResponse struct {
Sandboxes []SandboxInfo
NextToken string
}
ListSandboxesResponse contains one page of sandboxes and the next token.
type ListSnapshotsRequest ¶
ListSnapshotsRequest filters and paginates snapshot listing.
type ListSnapshotsResponse ¶
type ListSnapshotsResponse struct {
Snapshots []SnapshotInfo
NextToken string
}
ListSnapshotsResponse contains one page of snapshots and the next token.
type PTYConnectOptions ¶
type PTYConnectOptions struct {
OnData func([]byte)
}
PTYConnectOptions controls PTY stream callbacks.
type PTYStartRequest ¶
type PTYStartRequest struct {
Cols uint32
Rows uint32
WorkingDirectory string
Environment map[string]string
Tag string
OnData func([]byte)
}
PTYStartRequest starts a shell-backed PTY session.
type ProcessInfo ¶
type ProcessInfo struct {
PID uint32
Tag string
Command string
Args []string
Environment map[string]string
WorkingDirectory string
}
ProcessInfo describes a running command or PTY session.
type Sandbox ¶
type Sandbox struct {
// contains filtered or unexported fields
}
Sandbox is a handle to a live E2B microVM. Methods are safe for concurrent use.
func (*Sandbox) CloseStdin ¶
CloseStdin closes stdin for a running process.
func (*Sandbox) ConnectPTY ¶
func (s *Sandbox) ConnectPTY(ctx context.Context, pid uint32, options PTYConnectOptions) (*CommandHandle, error)
ConnectPTY reconnects to a running PTY session by PID.
func (*Sandbox) ConnectProcess ¶
func (s *Sandbox) ConnectProcess(ctx context.Context, pid uint32, options CommandConnectOptions) (*CommandHandle, error)
ConnectProcess reconnects to a running command stream by PID.
func (*Sandbox) CreatePTY ¶
func (s *Sandbox) CreatePTY(ctx context.Context, request PTYStartRequest) (*CommandHandle, error)
CreatePTY starts a shell-backed PTY session and returns a handle.
func (*Sandbox) CreateSnapshot ¶
func (s *Sandbox) CreateSnapshot(ctx context.Context, request CreateSnapshotRequest) (SnapshotInfo, error)
func (*Sandbox) Destroy ¶
Destroy terminates the sandbox. Safe to call more than once; only the first call hits the control plane. Returns nil when the sandbox was already gone.
func (*Sandbox) Exec ¶
func (s *Sandbox) Exec(ctx context.Context, request ExecRequest) (ExecResult, error)
Exec runs a command in the sandbox, collecting stdout and stderr, and returns once the process exits or the context is cancelled.
func (*Sandbox) GetMetrics ¶
func (s *Sandbox) GetMetrics(ctx context.Context, request SandboxMetricsRequest) ([]SandboxMetric, error)
func (*Sandbox) Kill ¶
Kill is an alias for Destroy to match the control-plane naming used in the upstream SDKs.
func (*Sandbox) KillProcess ¶
KillProcess sends SIGKILL to a running process.
func (*Sandbox) ListDir ¶
ListDir lists files, directories, and symlinks under the given path. Depth defaults to 1 when zero.
func (*Sandbox) ListFiles ¶
ListFiles enumerates files beneath the given prefix, up to 32 levels deep. Directories are skipped. When AllowShellFallback is set and the envd RPC fails, a `find` backstop is used.
func (*Sandbox) ListProcesses ¶
func (s *Sandbox) ListProcesses(ctx context.Context) ([]ProcessInfo, error)
ListProcesses lists running commands and PTY sessions.
func (*Sandbox) ListSnapshots ¶
func (s *Sandbox) ListSnapshots(ctx context.Context, request ListSnapshotsRequest) (ListSnapshotsResponse, error)
func (*Sandbox) MakeDir ¶
MakeDir creates a directory. It returns false when the directory already exists.
func (*Sandbox) ReadFile ¶
ReadFile returns the contents of a file inside the sandbox. When AllowShellFallback is set and the envd HTTP call fails, a shell-based `cat` is tried as a backstop.
func (*Sandbox) SendPTYInput ¶
SendPTYInput writes bytes to a running PTY session.
func (*Sandbox) SetTimeout ¶
func (*Sandbox) StartCommand ¶
func (s *Sandbox) StartCommand(ctx context.Context, request CommandStartRequest) (*CommandHandle, error)
StartCommand starts a background command and returns a handle.
func (*Sandbox) TemplateID ¶
TemplateID returns the template the sandbox was cloned from.
func (*Sandbox) WatchDir ¶
func (s *Sandbox) WatchDir(ctx context.Context, path string, options WatchOptions, onEvent func(FilesystemEvent)) (*WatchHandle, error)
WatchDir starts watching a directory for filesystem events.
type SandboxInfo ¶
type SandboxInfo struct {
SandboxID string
TemplateID string
Name string
Metadata map[string]string
StartedAt time.Time
EndAt time.Time
State SandboxState
CPUCount int
MemoryMB int
DiskSizeMB int
EnvdVersion string
AllowInternetAccess *bool
Domain string
Network *SandboxNetwork
Lifecycle *SandboxLifecycle
VolumeMounts []SandboxVolumeMount
}
SandboxInfo is returned by sandbox list/info APIs.
type SandboxLifecycle ¶
SandboxLifecycle describes timeout and auto-resume behavior.
type SandboxMetric ¶
type SandboxMetric struct {
Timestamp time.Time
TimestampUnix int64
CPUCount int
CPUUsedPct float64
MemUsed int64
MemTotal int64
DiskUsed int64
DiskTotal int64
}
SandboxMetric is a single resource-usage sample from the control plane.
type SandboxMetricsRequest ¶
SandboxMetricsRequest constrains the requested metric interval.
type SandboxNetwork ¶
type SandboxNetwork struct {
AllowPublicTraffic *bool
AllowOut []string
DenyOut []string
MaskRequestHost string
}
SandboxNetwork describes control-plane network configuration.
type SandboxState ¶
type SandboxState string
SandboxState is the control-plane lifecycle state of a sandbox.
const ( // SandboxStateRunning indicates the sandbox is running. SandboxStateRunning SandboxState = "running" // SandboxStatePaused indicates the sandbox is paused. SandboxStatePaused SandboxState = "paused" )
type SandboxVolumeMount ¶
SandboxVolumeMount describes a volume mounted into a sandbox.
type SnapshotInfo ¶
SnapshotInfo describes a persistent sandbox snapshot.
type Volume ¶
type Volume struct {
// contains filtered or unexported fields
}
Volume is a handle to a persistent E2B volume.
func (*Volume) MakeDir ¶
func (v *Volume) MakeDir(ctx context.Context, path string, options VolumeWriteOptions) (VolumeEntryInfo, error)
MakeDir creates a directory in the volume.
func (*Volume) UpdateMetadata ¶
func (v *Volume) UpdateMetadata(ctx context.Context, path string, options VolumeMetadataOptions) (VolumeEntryInfo, error)
UpdateMetadata updates uid/gid/mode for a volume path.
func (*Volume) WriteFile ¶
func (v *Volume) WriteFile(ctx context.Context, path string, content []byte, options VolumeWriteOptions) (VolumeEntryInfo, error)
WriteFile writes a file to the volume.
type VolumeAndToken ¶
VolumeAndToken describes a persistent volume plus its content API token.
type VolumeEntryInfo ¶
type VolumeEntryInfo struct {
Name string
Type VolumeEntryType
Path string
Size int64
Mode uint32
UID uint32
GID uint32
AccessTime time.Time
ModifiedTime time.Time
ChangeTime time.Time
Target string
}
VolumeEntryInfo describes a file or directory in a volume.
type VolumeEntryType ¶
type VolumeEntryType string
VolumeEntryType describes the type of a volume filesystem entry.
const ( VolumeEntryTypeUnknown VolumeEntryType = "unknown" VolumeEntryTypeFile VolumeEntryType = "file" VolumeEntryTypeDirectory VolumeEntryType = "directory" VolumeEntryTypeSymlink VolumeEntryType = "symlink" )
type VolumeInfo ¶
VolumeInfo describes a persistent volume.
type VolumeMetadataOptions ¶
VolumeMetadataOptions updates ownership or mode.
type VolumeWriteOptions ¶
VolumeWriteOptions controls file and directory creation.
type WatchHandle ¶
type WatchHandle struct {
// contains filtered or unexported fields
}
WatchHandle controls a running directory watch.
func (*WatchHandle) Wait ¶
func (h *WatchHandle) Wait() error
Wait blocks until the watch exits. A normal Stop returns nil.
type WatchOptions ¶
type WatchOptions struct {
Recursive bool
}
WatchOptions configures sandbox directory watches.