Documentation
¶
Overview ¶
Package workspace defines the shared storage backend that every agent execution node mounts. All nodes in a deployment read and write the same workspace, so state lives in exactly one place regardless of how many agents are running.
The interface is a minimal blob store so that backends (a local directory today; GCS, S3, or similar later) can slot in without touching any other package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidKey = errors.New("workspace: invalid key")
ErrInvalidKey is returned when a key is empty, absolute, or attempts to escape the workspace (e.g. contains "..").
var ErrNotFound = errors.New("workspace: key not found")
ErrNotFound is returned when a key does not exist in the workspace.
Functions ¶
Types ¶
type Local ¶
type Local struct {
// contains filtered or unexported fields
}
Local is a Workspace backed by a directory on the local filesystem. It is the default backend for single-machine deployments and for tests.
type Workspace ¶
type Workspace interface {
// Read opens the blob at key. The caller must close the returned reader.
// Returns ErrNotFound if the key does not exist.
Read(ctx context.Context, key string) (io.ReadCloser, error)
// Write stores the blob at key, replacing any existing value.
Write(ctx context.Context, key string, r io.Reader) error
// List returns all keys under prefix in lexical order. An empty prefix
// lists every key.
List(ctx context.Context, prefix string) ([]string, error)
// Delete removes the blob at key. Returns ErrNotFound if the key does
// not exist.
Delete(ctx context.Context, key string) error
}
Workspace is a flat, prefix-addressable blob store shared by every node in a deployment. Keys are slash-separated relative paths such as "runs/42/output.json".