54 lines
1.4 KiB
Go
54 lines
1.4 KiB
Go
package s3
|
|
|
|
type S3ObjectStorageConfigurationProvider interface {
|
|
GetAccessKey() string
|
|
GetSecretKey() string
|
|
GetEndpoint() string
|
|
GetRegion() string
|
|
GetBucketName() string
|
|
GetIsPublicBucket() bool
|
|
}
|
|
|
|
type s3ObjectStorageConfigurationProviderImpl struct {
|
|
accessKey string
|
|
secretKey string
|
|
endpoint string
|
|
region string
|
|
bucketName string
|
|
isPublicBucket bool
|
|
}
|
|
|
|
func NewS3ObjectStorageConfigurationProvider(accessKey, secretKey, endpoint, region, bucketName string, isPublicBucket bool) S3ObjectStorageConfigurationProvider {
|
|
return &s3ObjectStorageConfigurationProviderImpl{
|
|
accessKey: accessKey,
|
|
secretKey: secretKey,
|
|
endpoint: endpoint,
|
|
region: region,
|
|
bucketName: bucketName,
|
|
isPublicBucket: isPublicBucket,
|
|
}
|
|
}
|
|
|
|
func (s *s3ObjectStorageConfigurationProviderImpl) GetAccessKey() string {
|
|
return s.accessKey
|
|
}
|
|
|
|
func (s *s3ObjectStorageConfigurationProviderImpl) GetSecretKey() string {
|
|
return s.secretKey
|
|
}
|
|
|
|
func (s *s3ObjectStorageConfigurationProviderImpl) GetEndpoint() string {
|
|
return s.endpoint
|
|
}
|
|
|
|
func (s *s3ObjectStorageConfigurationProviderImpl) GetRegion() string {
|
|
return s.region
|
|
}
|
|
|
|
func (s *s3ObjectStorageConfigurationProviderImpl) GetBucketName() string {
|
|
return s.bucketName
|
|
}
|
|
|
|
func (s *s3ObjectStorageConfigurationProviderImpl) GetIsPublicBucket() bool {
|
|
return s.isPublicBucket
|
|
}
|