Documentation ¶
Index ¶
- type ClientConfigData
- type MethodInterface
- type S3Client
- func (client *S3Client) BucketExists(bucketName string) (bucketExists bool, err error)
- func (client *S3Client) ChangeObjectName(bucketName, oldObjectKey, newObjectKey string) error
- func (client *S3Client) DeleteObjects(bucketName string, objectKeys []string) error
- func (client *S3Client) S3ObjectExists(objectKey, bucketName string) (objectExists bool, err error)
- func (client *S3Client) UploadFile(bucketName string, objectKey string, fileBytes []byte) error
- type S3Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientConfigData ¶
func S3ProductionConfig ¶
func S3ProductionConfig() (awsClientConfig *ClientConfigData, bucketName string, err error)
Retrieve configuration data (eg. aws region, access key) from .env file for production settings only Base parameter for dependency injection of aws client (production)
type MethodInterface ¶
type MethodInterface struct {
RepositoryInterfaceS3 S3Repository
}
func GetAwsMethods ¶
func GetAwsMethods(awsClientConfig *ClientConfigData) (awsClientMethods *MethodInterface, err error)
func NewAwsMethodInterface ¶
func NewAwsMethodInterface(s3Client *S3Client) *MethodInterface
type S3Client ¶
func NewAwsClient ¶
func NewAwsClient(awsClientConfig *ClientConfigData) (client *S3Client, err error)
func (*S3Client) BucketExists ¶
//////////////////////////////////////////////////////////// Validate if S3 bucket exists ////////////////////////////////
func (*S3Client) ChangeObjectName ¶
/////////////////////////////////////////////////////////////////////// List all virtual folders inside a virtual S3 folder (folderPrefix) ///////////////////////////////////
func (*S3Client) DeleteObjects ¶
//////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// Delete object from aws S3 bucket
func (*S3Client) S3ObjectExists ¶
//////////////////////////////////////////////////////////// Check if object in S3 bucket exists ///////////////////////////////////
type S3Repository ¶
type S3Repository interface { UploadFile(bucketName string, objectKey string, fileBytes []byte) error BucketExists(bucketName string) (bucketExists bool, err error) DeleteObjects(bucketName string, objectKeys []string) error S3ObjectExists(objectKey, bucketName string) (objectExists bool, err error) ChangeObjectName(bucketName, oldObjectKey, newObjectKey string) error }
/////////////////////////////////////////////////////////// Setup interface for AWS S3 repository utilizing Dependency Injection /////////////////////