storage

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package storage defines the Provider interface for object storage backends.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerFileOpener

type ContainerFileOpener interface {
	OpenContainerFile(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.
	// The format depends on the backend (e.g. container path, signed URL).
	AccessPath(key string) string
}

Provider abstracts object storage operations.

Directories

Path Synopsis
providers
containerfs
Package containerfs implements storage.Provider for bot containers backed by host-side bind mounts.
Package containerfs implements storage.Provider for bot containers backed by host-side bind mounts.

Jump to

Keyboard shortcuts

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