storage

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProviderLocal = internalstorage.ProviderLocal
	ProviderS3    = internalstorage.ProviderS3
)

Variables

This section is empty.

Functions

func DetectContentType

func DetectContentType(filename string) string

DetectContentType returns the MIME type for a file name from its extension, or application/octet-stream when the extension is unknown.

func HealthCheck

func HealthCheck(ctx context.Context) error

HealthCheck verifies that the shared storage provider can be created and used: it writes a small test object, checks that it exists, has the right size and can be opened, then deletes it. The error says which step failed.

func SetConfig

func SetConfig(cfg Config)

SetConfig sets the storage configuration used when the shared provider is first created. Call it before the first use of the storage; it does not replace a provider that already exists.

Types

type ArtifactMetadata

type ArtifactMetadata = internalstorage.ArtifactMetadata

ArtifactMetadata is the persisted control-plane record associated with a blob. It lets the runtime run GC, checks integrity, and prepare future document/RAG features without coupling this package to a specific database.

type ArtifactNamespace

type ArtifactNamespace = internalstorage.ArtifactNamespace

ArtifactNamespace groups stored objects by runtime-level responsibility. These prefixes are intentionally generic so the core can stay reusable while backend layers add higher-level document, RAG, or tenant semantics on top.

type ArtifactPutRequest

type ArtifactPutRequest = internalstorage.ArtifactPutRequest

ArtifactPutRequest describes a runtime-level persisted artifact. The artifact store derives the storage key from this struct so callers do not duplicate key layout logic across browser, fetch, and future RAG layers.

type ArtifactRef

type ArtifactRef = internalstorage.ArtifactRef

ArtifactRef is the stable runtime-facing handle returned after persisting a blob. Callers should pass these refs around instead of assuming a local path or S3 URL.

type ArtifactRetentionClass

type ArtifactRetentionClass = internalstorage.ArtifactRetentionClass

ArtifactRetentionClass controls lifecycle defaults for persisted artifacts.

type ArtifactStore

type ArtifactStore = internalstorage.ArtifactStore

ArtifactStore is the narrow abstraction consumed by browser/fetch/document layers. It deliberately hides provider-specific details so the runtime can switch between local and object storage without leaking infra concerns into web packages.

func DefaultArtifactStore

func DefaultArtifactStore() (ArtifactStore, error)

DefaultArtifactStore returns the process-wide artifact store backed by the configured provider.

func NewArtifactStore

func NewArtifactStore(provider StorageProvider) ArtifactStore

NewArtifactStore adapts an existing provider into the narrower artifact interface.

func NewArtifactStoreFromConfig

func NewArtifactStoreFromConfig(cfg Config) (ArtifactStore, error)

NewArtifactStoreFromConfig creates an artifact store from an explicit Config, bypassing the process-wide provider singleton. Use when different SDK clients need independent storage backends.

type Config

type Config = internalstorage.Config

Config describes where artifacts are stored: the provider (local directory or S3) and its settings (the local path; the endpoint, bucket, credentials, region and key prefix of S3).

type GCOptions

type GCOptions = internalstorage.GCOptions

GCOptions controls artifact garbage collection.

type GCReport

type GCReport = internalstorage.GCReport

GCReport summarizes one garbage collection pass.

type ListOptions

type ListOptions = internalstorage.ListOptions

ListOptions bounds provider-side listings so callers can enumerate namespaces without loading the full storage tree into memory.

type LocalProvider

type LocalProvider = internalstorage.LocalProvider

LocalProvider is a StorageProvider that keeps the objects as files under a base directory.

func NewLocalProviderWithConfig

func NewLocalProviderWithConfig(cfg Config) (*LocalProvider, error)

NewLocalProviderWithConfig creates a LocalProvider on cfg.LocalPath, or on the default local path when it is empty, creating the directory if needed.

type ProviderType

type ProviderType = internalstorage.ProviderType

ProviderType names a kind of storage backend: local or s3.

func GetProviderType

func GetProviderType() ProviderType

GetProviderType returns the provider chosen by the SESHAT_STORAGE_PROVIDER environment variable: s3 for "s3", local otherwise.

type StorageProvider

type StorageProvider = internalstorage.StorageProvider

StorageProvider is a store of binary objects addressed by key: upload, download, stream, stat, list, delete, produce a URL, and test for existence.

Jump to

Keyboard shortcuts

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