Documentation ¶
Overview ¶
Package s3 imlements wrappers for AWS S3 service
Uses the default AWS SDK Credentials; e.g. via the environment AWS_REGION=region AWS_ACCESS_KEY_ID=key AWS_SECRET_ACCESS_KEY=secret OR in the AWS SDK credential configurtion ~/.aws/credentials:
aws_access_key_id = AKID aws_secret_access_key = SECRET aws_session_token = TOKEN
See: https://docs.aws.amazon.com/sdk-for-go/api/aws/session/#pkg-overview
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileManager ¶
type FileManager interface { Download(fileName, containerName, sourceName, destinationName string) (string, error) List(bucket, prefix string) ([]Entry, error) Upload(fileName, containerName, key string) (string, error) }
FileManager generic file downloader interfacae
type LocalManager ¶
type LocalManager struct{ SourceDirectory, DestinationDirctory string }
LocalManager - local file system file manages (for testing)
func (LocalManager) Download ¶
func (m LocalManager) Download(sourceName, s3BucketName, s3Key, dest string) (string, error)
Download simulates download from the SourceDirectory
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager AWS S3 file downloader
func NewManager ¶
NewManager instantiates an AWS S3 file Manager
func NewManagerWithCredentials ¶
NewManagerWithCredentials instantiates an AWS S3 file manager
func (Manager) Download ¶
func (m Manager) Download( SourceName, S3BucketName, S3Key, DestinationFileName string) (string, error)
Download downloads a file form the given bucket to the destination file.