Documentation ¶
Index ¶
- type AwsClientConfigData
- type AwsMethodInterface
- type S3Client
- func (awsS3 *S3Client) BucketExists(bucketName string) (bool, error)
- func (awsS3 *S3Client) DeleteFolderContents(bucketName, folderPrefix string) error
- func (awsS3 *S3Client) DeleteObjects(bucketName string, objectKeys []string) error
- func (awsS3 *S3Client) ListFolderNamesS3(bucketName, folderPrefix string) ([]string, error)
- func (awsS3 *S3Client) S3ObjectExists(key, bucketName string) (bool, error)
- func (client *S3Client) UploadFile(bucketName string, objectKey string, filePath string) error
- type S3Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AwsClientConfigData ¶
func AwsS3ProductionConfig ¶
func AwsS3ProductionConfig() (awsClientConfig *AwsClientConfigData, 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 AwsMethodInterface ¶
type AwsMethodInterface struct {
MethodInterface S3Repository
}
func GetAwsMethods ¶
func GetAwsMethods(awsClientConfig *AwsClientConfigData) (awsClientMethods *AwsMethodInterface, err error)
func NewAwsMethodInterface ¶
func NewAwsMethodInterface(s3Client *S3Client) *AwsMethodInterface
type S3Client ¶
func NewAwsClient ¶
func NewAwsClient(awsClientConfig *AwsClientConfigData) (client *S3Client, err error)
func (*S3Client) BucketExists ¶
//////////////////////////////////////////////////////////// Validate if S3 bucket exists ////////////////////////////////
func (*S3Client) DeleteFolderContents ¶
////////////////////////////////////////////////////////////////////////////////////// DeleteFolderContents recursively deletes all objects and subfolders within a folder ////////////////////
func (*S3Client) DeleteObjects ¶
//////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// Delete object from aws S3 bucket
func (*S3Client) ListFolderNamesS3 ¶
//////////////////////////////////////////////////////////// List all virtual folders inside a virtual S3 folder (folderPrefix) ///////////////////////////////////
func (*S3Client) S3ObjectExists ¶
//////////////////////////////////////////////////////////// Check if object in S3 bucket exists ///////////////////////////////////
type S3Repository ¶
type S3Repository interface { UploadFile(bucketName string, objectKey string, filePath string) error DeleteObjects(bucketName string, objectKeys []string) error ListFolderNamesS3(bucketName, folderPrefix string) ([]string, error) DeleteFolderContents(bucketName, folderPrefix string) error BucketExists(bucketName string) (bool, error) }
/////////////////////////////////////////////////////////// Setup interface for AWS S3 repository utilizing Dependency Injection /////////////////////