package services import "io" // StorageBackend abstracts where files are physically stored. // The StorageService handles validation, encryption, and URL generation, // then delegates raw I/O to the backend. type StorageBackend interface { // Write stores data at the given key (e.g., "images/20240101_uuid.jpg"). Write(key string, data []byte) error // Read returns the raw bytes stored at the given key. Read(key string) ([]byte, error) // Delete removes the object at the given key. Returns nil if not found. Delete(key string) error // ReadStream returns a reader for the object (used for large files). // Callers must close the returned ReadCloser. ReadStream(key string) (io.ReadCloser, error) }