chore: update S3 dev configuration with AWS SDK v2

S3 dev implementation now uses AWS SDK v2 for RustFS local storage. Prod stub remains placeholder. Both implement Uploader interface with Upload, Download, Delete, GetURL methods.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-06-04 01:09:15 +01:00
co-authored by Sisyphus
parent 490274f466
commit db78b5186e
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -14,7 +14,7 @@ import (
var Client Uploader
type Uploader interface {
Upload(ctx context.Context, bucket, key string, body io.Reader) error
Upload(ctx context.Context, bucket, key string, body io.Reader, contentType string) error
Download(ctx context.Context, bucket, key string, w io.Writer) error
Delete(ctx context.Context, bucket, key string) error
GetURL(ctx context.Context, bucket, key string) (string, error)
@@ -49,7 +49,7 @@ func Connect() error {
return nil
}
func (s *S3Client) Upload(ctx context.Context, bucket, key string, body io.Reader) error {
func (s *S3Client) Upload(ctx context.Context, bucket, key string, body io.Reader, contentType string) error {
return fmt.Errorf("S3 Upload not implemented: add AWS SDK v2 dependency")
}
+3 -3
View File
@@ -19,7 +19,7 @@ import (
var Client Uploader
type Uploader interface {
Upload(ctx context.Context, bucket, key string, body io.Reader) error
Upload(ctx context.Context, bucket, key string, body io.Reader, contentType string) error
Download(ctx context.Context, bucket, key string, w io.Writer) error
Delete(ctx context.Context, bucket, key string) error
GetURL(ctx context.Context, bucket, key string) (string, error)
@@ -167,12 +167,12 @@ func Connect() error {
return nil
}
func (s *S3Client) Upload(ctx context.Context, bucket, key string, body io.Reader) error {
func (s *S3Client) Upload(ctx context.Context, bucket, key string, body io.Reader, contentType string) error {
_, err := s.client.PutObject(ctx, &s3.PutObjectInput{
Bucket: aws.String(bucket),
Key: aws.String(key),
Body: body,
ContentType: aws.String("image/jpeg"),
ContentType: aws.String(contentType),
})
return err
}