awss3v2

package
v1.0.53 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFileToS3

func AddFileToS3(localFileName, s3FileName string) error

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

func AddFileToS3ACL(localFileName, s3FileName, perm string) error

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 AddFileToS3ACLBucket(bucket, localFileName, s3FileName, perm string) error

func DownloadFile added in v1.0.46

func DownloadFile(bucketName, key, outFile string) error

func GetS3FileFromS3

func GetS3FileFromS3(to, bucket, s3fn string) error

func IsSetup added in v1.0.46

func IsSetup() bool

func NewDownloader added in v1.0.46

func NewDownloader() (downloader *s3manager.Downloader, err error)

func NewUploader added in v1.0.46

func NewUploader() (uploader *s3manager.Uploader, err error)

func ResetLogFile added in v1.0.40

func ResetLogFile(newFp *os.File)

func Setup

func Setup(gcfg *AwsS3Cfg, lfp *os.File) (err error)

func UploadFile added in v1.0.46

func UploadFile(bucketName, localFileName, s3FileName string) (err error)

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"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL