storage

package
v0.19.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package storage defines the Provider interface for object storage backends.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrContainerFileNotSupported is returned when no underlying provider
	// implements ContainerFileOpener.
	ErrContainerFileNotSupported = errors.New("provider does not support workspace file reading")
	// ErrAccessPathUnavailable means the stored bytes cannot currently be made
	// addressable in the target consumer's filesystem namespace.
	ErrAccessPathUnavailable = errors.New("storage object has no consumer-accessible path")
)

Functions

This section is empty.

Types

type AccessPathEnsurer

type AccessPathEnsurer interface {
	EnsureAccessPath(ctx context.Context, key string) (string, error)
}

AccessPathEnsurer is implemented by providers that can materialize an object into consumer-addressable storage before returning its path.

type ContainerFileOpener

type ContainerFileOpener interface {
	OpenContainerFile(ctx context.Context, botID, containerPath string) (io.ReadCloser, error)
}

ContainerFileOpener is an optional interface that providers can implement to open arbitrary files from a bot's container data directory.

type PrefixLister

type PrefixLister interface {
	ListPrefix(ctx context.Context, prefix string) ([]string, error)
}

PrefixLister is an optional interface for providers that can list keys sharing a common prefix (e.g. directory listing on a filesystem backend).

type Provider

type Provider interface {
	// Put writes data to storage under the given key.
	Put(ctx context.Context, key string, reader io.Reader) error
	// Open returns a reader for the given storage key.
	Open(ctx context.Context, key string) (io.ReadCloser, error)
	// Delete removes the object at key.
	Delete(ctx context.Context, key string) error
	// AccessPath returns a consumer-accessible reference for a storage key, or
	// an empty string when no reachable reference can be resolved. Resolution
	// may perform I/O and must honor ctx. The format depends on the backend
	// (e.g. container path, signed URL).
	AccessPath(ctx context.Context, key string) string
}

Provider abstracts object storage operations.

Directories

Path Synopsis
providers
containerfs
Package containerfs implements storage.Provider for bot containers backed by gRPC calls to the in-container MCP service.
Package containerfs implements storage.Provider for bot containers backed by gRPC calls to the in-container MCP service.
fallback
Package fallback implements storage.Provider that tries a primary provider first (e.g.
Package fallback implements storage.Provider that tries a primary provider first (e.g.
localfs
Package localfs implements storage.Provider backed by the host filesystem.
Package localfs implements storage.Provider backed by the host filesystem.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL