Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsUserAssetKey ¶
func KeyForPath ¶
KeyForPath returns the slash-separated key for abs relative to stellaHome.
func ValidateKey ¶
ValidateKey rejects absolute and traversal keys while preserving slash paths.
Types ¶
type FSStore ¶
type FSStore struct {
// contains filtered or unexported fields
}
func NewFSStore ¶
type S3Store ¶
type S3Store struct {
// contains filtered or unexported fields
}
func NewS3Store ¶
type Store ¶
type Store interface {
Put(ctx context.Context, key string, r io.Reader) error
Open(ctx context.Context, key string) (io.ReadCloser, error)
Delete(ctx context.Context, key string) error
// List returns every key under prefix, as slash-separated keys relative to
// the store root. prefix is validated with the same rules as a key
// (traversal/absolute rejected). A prefix pointing at nothing yields an
// empty slice, not an error.
List(ctx context.Context, prefix string) ([]string, error)
}
Store persists durable user assets by STELLA_HOME-relative slash keys. It is a low-level object-store port: the authoritative asset semantics (durable-write, local materialization, restore, move, delete, cold-pod hydration) live in internal/asset, which is the only package that holds a Store. Transports and channel plugins receive the narrow asset ports, never this interface, and there is deliberately no process-global default: an asset store is injected.
func NewStoreFromConfig ¶
func NewStoreFromConfig(c config.BlobS3Config) (Store, error)
NewStoreFromConfig builds the blob store from the raw S3 settings on the server config snapshot. It owns the group semantics the config layer deliberately does not: none set => no store (nil, nil); any set => the four core fields are required together; and the USE_SSL bool dialect (1/true/t/yes/y/on vs 0/false/f/no/n/off, default true) is preserved exactly rather than narrowed to strconv.ParseBool.