blob

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package blob is the object-storage port for media attribute values. The bytes of a file/image live behind this interface; the attribute value itself only carries metadata (object key, mime, size). Implementations include local disk (below) and, for the hosted tier, an S3-compatible store — either satisfies the same contract.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store interface {
	// Put stores an object's bytes and its MIME type under key, overwriting
	// any existing object.
	Put(ctx context.Context, key string, r io.Reader, mime string) error
	// Open returns a reader over the object and its stored MIME type.
	Open(ctx context.Context, key string) (io.ReadCloser, string, error)
	// Delete removes the object; deleting a missing key is not an error.
	Delete(ctx context.Context, key string) error
}

Store persists opaque objects keyed by a string. Keys are chosen by the caller and must be treated as untrusted paths by implementations.

func NewDiskStore

func NewDiskStore(dir string) (Store, error)

NewDiskStore builds a disk-backed blob store rooted at dir, creating it if necessary.

func NewMemoryStore

func NewMemoryStore() Store

NewMemoryStore builds an in-memory blob store.

Jump to

Keyboard shortcuts

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