-
-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
s3: storage class for files in result storage bucket #402
Conversation
9a8400d
to
ec43b63
Compare
storage/s3storage/option.go
Outdated
|
||
func WithFileStorageClass(storageClass string) Option { | ||
return func(h *S3Storage) { | ||
switch storageClass { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems clearer and simpler keeping the string as it is?
i.e. REDUCED_REDUNDANCY
, STANDARD_IA
etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
config/awsconfig/awsconfig.go
Outdated
@@ -90,6 +91,8 @@ func WithAWS(fs *flag.FlagSet, cb func() (*zap.Logger, bool)) imagor.Option { | |||
"Upload ACL for S3 Result Storage") | |||
s3ResultStorageExpiration = fs.Duration("s3-result-storage-expiration", 0, | |||
"S3 Result Storage expiration duration e.g. 24h. Default no expiration") | |||
s3FileStorageClass = fs.String("s3-file-storage-class", "STANDARD", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better rename to s3StorageClass
, s3-storage-class
? As file storage would result confusion with file system storage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should also add storage class to s3 storage, not only result storage. See
https://github.com/cshum/imagor/pull/402/files#diff-f58e37fdae6c04a8b5d1c70ee04a0c95bbab1a4f55ad66f0ee69796b8fd4730cR165
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add test case around https://github.com/cshum/imagor/blob/master/config/awsconfig/awsconfig_test.go
- default should expect
STANDARD
- a valid setting e.g.
REDUCED_REDUNDANCY
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
More about Storage Class:
https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html
Briefly from
aws-sdk-go
: