mirror of
https://github.com/Dvorinka/Primora.git
synced 2026-10-28 15:51:23 +00:00
BACKEND_STORAGE_DRIVER=s3 swaps LocalStore for a stdlib-only SigV4 implementation — PutObject/GetObject/DeleteObject/CopyObject/ListObjectsV2 against any S3-compatible API (AWS, MinIO, Garage, R2). Storage becomes a Store interface; storage_path records s3://bucket/key. Content-Length is resolved by seeking or temp-file spooling — chunked uploads are rejected by real S3 servers. Bucket auto-created on startup. Verified live against zenko/cloudserver: bucket, put, get, copy, delete. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
17 lines
548 B
Go
17 lines
548 B
Go
package storage
|
|
|
|
import (
|
|
"context"
|
|
"io"
|
|
)
|
|
|
|
// Store is the object-storage contract the platform service depends on.
|
|
// LocalStore keeps objects on disk; S3Store targets S3-compatible APIs.
|
|
type Store interface {
|
|
Put(ctx context.Context, bucketID, objectKey string, reader io.Reader) (PutResult, error)
|
|
Open(bucketID, objectKey string) (io.ReadCloser, string, error)
|
|
Delete(bucketID, objectKey string) error
|
|
MoveBetweenBuckets(sourceBucketID, destinationBucketID, fromKey, toKey string) (string, error)
|
|
DeleteBucket(bucketID string) error
|
|
}
|