From 831aa7f468ff696da2ac05d68d3f6664cfcee93d Mon Sep 17 00:00:00 2001 From: linxside Date: Sat, 3 Jan 2026 21:10:24 +0100 Subject: [PATCH] s3: add storage_class option --- backends/s3/s3.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backends/s3/s3.go b/backends/s3/s3.go index 92330b5..29ba98d 100644 --- a/backends/s3/s3.go +++ b/backends/s3/s3.go @@ -70,6 +70,10 @@ type Options struct { // Region defaults to "us-east-1", which also works for Minio Region string `yaml:"region"` Bucket string `yaml:"bucket"` + + // StorageClass allows setting the S3 Storage Class only when storing objects. + StorageClass string `yaml:"storage_class"` + // CreateBucket tells us to try to create the bucket CreateBucket bool `yaml:"create_bucket"` @@ -363,6 +367,7 @@ func (b *Backend) doStoreReader(ctx context.Context, name string, r io.Reader, s putObjectOptions := minio.PutObjectOptions{ NumThreads: b.opt.NumMinioThreads, SendContentMd5: !b.opt.DisableContentMd5, + StorageClass: b.opt.StorageClass, } // minio accepts size == -1, meaning the size is unknown.