refac: decouple persistence and image storage behind driver registries

This commit is contained in:
fsylvain committed 2026-10-06 02:13:35 +02:00
1 parent 421cfafec3
commit 81e299f09a
46 files changed
+1036 -374

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
package image
import (
"errors"
"io"
"time"
)
var ErrBlobNotFound = errors.New("stored image content not found")
const PublicPathPrefix = "/static/uploadedImages/"
func PublicPath(storedName string) string {
return PublicPathPrefix + storedName
}
type Blob struct {
Content io.ReadCloser
Size int64
ModTime time.Time
}
type Storage interface {
Put(contentType string, content io.Reader) (string, error)
Open(storedName string) (Blob, error)
Delete(storedName string) error
}