()
| 24 | ) |
| 25 | |
| 26 | func init() { |
| 27 | // Initialize the S3 client outside of the handler, during the init phase |
| 28 | cfg, err := config.LoadDefaultConfig(context.TODO()) |
| 29 | if err != nil { |
| 30 | log.Fatalf("unable to load SDK config, %v", err) |
| 31 | } |
| 32 | |
| 33 | s3Client = s3.NewFromConfig(cfg) |
| 34 | } |
| 35 | |
| 36 | func uploadReceiptToS3(ctx context.Context, bucketName, key, receiptContent string) error { |
| 37 | _, err := s3Client.PutObject(ctx, &s3.PutObjectInput{ |
nothing calls this directly
no outgoing calls
no test coverage detected