This commit is contained in:
CFOU
2026-09-14 20:50:19 +02:00
commit 3091fb4020
135 changed files with 10262 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
package media
import (
"context"
"io"
)
// Storage is the pluggable backend that actually persists uploaded bytes.
// The service/handler layers never know whether files end up on local disk
// or in an S3 bucket -- only main.go decides which implementation to wire
// in, based on MEDIA_STORAGE_DRIVER.
type Storage interface {
// Save persists the content under the given key and returns the
// publicly reachable URL for it.
Save(ctx context.Context, key string, reader io.Reader, size int64, contentType string) (url string, err error)
// Delete removes the object identified by key. Deleting a
// already-removed key must not be treated as an error.
Delete(ctx context.Context, key string) error
}