thread-master/apps/backend/internal/module/filestorage/domain/storage.go

16 lines
517 B
Go
Raw Normal View History

2026-07-10 12:54:45 +00:00
package domain
import "context"
// Storage — object storage (MinIO / S3 / local).
type Storage interface {
// Upload writes bytes; returns public URL and object key.
Upload(ctx context.Context, key string, data []byte, contentType string) (publicURL string, err error)
// Delete removes object by key (best-effort).
Delete(ctx context.Context, key string) error
// Enabled is false when no backend configured (caller may reject uploads).
Enabled() bool
// Name for logs: s3 | local | noop
Name() string
}