Initial commit: Open sourcing all of the Maple Open Technologies code.

This commit is contained in:
Bartlomiej Mika 2025-12-02 14:33:08 -05:00
commit 755d54a99d
2010 changed files with 448675 additions and 0 deletions

View file

@ -0,0 +1,62 @@
// monorepo/cloud/maplefileapps-backend/pkg/storage/object/s3/config.go
package s3
type S3ObjectStorageConfigurationProvider interface {
GetAccessKey() string
GetSecretKey() string
GetEndpoint() string
GetRegion() string
GetBucketName() string
GetIsPublicBucket() bool
GetUsePathStyle() bool
}
type s3ObjectStorageConfigurationProviderImpl struct {
accessKey string `env:"AWS_ACCESS_KEY,required"`
secretKey string `env:"AWS_SECRET_KEY,required"`
endpoint string `env:"AWS_ENDPOINT,required"`
region string `env:"AWS_REGION,required"`
bucketName string `env:"AWS_BUCKET_NAME,required"`
isPublicBucket bool `env:"AWS_IS_PUBLIC_BUCKET"`
usePathStyle bool `env:"AWS_USE_PATH_STYLE"`
}
func NewS3ObjectStorageConfigurationProvider(accessKey, secretKey, endpoint, region, bucketName string, isPublicBucket, usePathStyle bool) S3ObjectStorageConfigurationProvider {
return &s3ObjectStorageConfigurationProviderImpl{
accessKey: accessKey,
secretKey: secretKey,
endpoint: endpoint,
region: region,
bucketName: bucketName,
isPublicBucket: isPublicBucket,
usePathStyle: usePathStyle,
}
}
func (me *s3ObjectStorageConfigurationProviderImpl) GetAccessKey() string {
return me.accessKey
}
func (me *s3ObjectStorageConfigurationProviderImpl) GetSecretKey() string {
return me.secretKey
}
func (me *s3ObjectStorageConfigurationProviderImpl) GetEndpoint() string {
return me.endpoint
}
func (me *s3ObjectStorageConfigurationProviderImpl) GetRegion() string {
return me.region
}
func (me *s3ObjectStorageConfigurationProviderImpl) GetBucketName() string {
return me.bucketName
}
func (me *s3ObjectStorageConfigurationProviderImpl) GetIsPublicBucket() bool {
return me.isPublicBucket
}
func (me *s3ObjectStorageConfigurationProviderImpl) GetUsePathStyle() bool {
return me.usePathStyle
}