-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdump.txt
37 lines (31 loc) · 1.26 KB
/
dump.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// func uploadFileToS3(s *session.Session, fileName string) error {
// // open the file for use
// file, err := os.Open(fileName)
// if err != nil {
// return err
// }
// defer file.Close()
// // get the file size and read
// // the file content into a buffer
// fileInfo, _ := file.Stat()
// var size = fileInfo.Size()
// buffer := make([]byte, size)
// file.Read(buffer)
// // config settings: this is where you choose the bucket,
// // filename, content-type and storage class of the file
// // you're uploading
// e, s3err := s3.New(s).PutObject(&s3.PutObjectInput{
// Bucket: aws.String(S3_BUCKET),
// Key: aws.String(fileName),
// ACL: aws.String("private"),
// Body: bytes.NewReader(buffer),
// ContentLength: aws.Int64(size),
// ContentType: aws.String(http.DetectContentType(buffer)),
// ContentDisposition: aws.String("attachment"),
// ServerSideEncryption: aws.String("AES256"),
// StorageClass: aws.String("INTELLIGENT_TIERING"),
// })
// return s3err
}
// AwsS3Region = os.Getenv("AWS_REGION")
// AwsS3Bucket = os.Getenv("AWS_BUCKET")