Documentation ¶
Index ¶
- func AddFileToS3(localFileName, s3FileName string) error
- func AddFileToS3ACL(localFileName, s3FileName, perm string) error
- func AddFileToS3ACLBucket(bucket, localFileName, s3FileName, perm string) error
- func DownloadFile(bucketName, key, outFile string) error
- func GetS3FileFromS3(to, bucket, s3fn string) error
- func IsSetup() bool
- func NewDownloader() (downloader *s3manager.Downloader, err error)
- func NewUploader() (uploader *s3manager.Uploader, err error)
- func ResetLogFile(newFp *os.File)
- func Setup(gcfg *AwsS3Cfg, lfp *os.File) (err error)
- func UploadFile(bucketName, localFileName, s3FileName string) (err error)
- type AwsS3Cfg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddFileToS3 ¶
AddFileToS3 will upload a single file to S3, it will require a pre-built aws session and will set file info like content type and encryption on the uploaded file. func AddFileToS3(s *session.Session, localFileName, s3FileName string) error {
func AddFileToS3ACL ¶
AddFileToS3ACL will upload a single file to S3, it will require a pre-built aws session and will set file info like content type and encryption on the uploaded file.
perm must be "public-read" or "private".
func AddFileToS3ACLBucket ¶
func DownloadFile ¶ added in v1.0.46
func GetS3FileFromS3 ¶
func NewDownloader ¶ added in v1.0.46
func NewDownloader() (downloader *s3manager.Downloader, err error)
func NewUploader ¶ added in v1.0.46
func ResetLogFile ¶ added in v1.0.40
func UploadFile ¶ added in v1.0.46
Types ¶
type AwsS3Cfg ¶
type AwsS3Cfg struct { S3_Region string `json:"aws_s3_region" default:"us-east-1"` S3_Bucket string `json:"aws_s3_bucket" default:"a-document"` S3_Perms string `json:"aws_s3_perms" default:"private"` AwsAccessKeyId string `json:"AwsAccessKeyId" default:"$ENV$AWS_ACCESS_KEY_ID"` AwsSecretAccessKeyId string `json:"AwsSecretAccessKeyId" default:"$ENV$AWS_SECRET_ACCESS_KEY"` }
Click to show internal directories.
Click to hide internal directories.