Documentation
¶
Index ¶
- Constants
- func DetectContentType(filename string) string
- func HealthCheck(ctx context.Context) error
- func SetConfig(cfg Config)
- type ArtifactMetadata
- type ArtifactNamespace
- type ArtifactPutRequest
- type ArtifactRef
- type ArtifactRetentionClass
- type ArtifactStore
- type Config
- type GCOptions
- type GCReport
- type ListOptions
- type LocalProvider
- type ProviderType
- type StorageProvider
Constants ¶
const ( ProviderLocal = internalstorage.ProviderLocal ProviderS3 = internalstorage.ProviderS3 )
Variables ¶
This section is empty.
Functions ¶
func DetectContentType ¶
DetectContentType returns the MIME type for a file name from its extension, or application/octet-stream when the extension is unknown.
func HealthCheck ¶
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.
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.