Struct: s3crypto.S3SaveStrategy

import "../ibm-cos-sdk-go/service/s3/s3crypto"

Overview

S3SaveStrategy will save the metadata to a separate instruction file in S3

Implemented Interfaces

s3crypto.Cipher, s3manager.ReadSeekerWriteTo, s3crypto.SaveStrategy, s3manager.WriterReadFrom

Structure Field Summary collapse

Method Summary collapse

Structure Field Details

Client *s3.S3

InstructionFileSuffix string

Method Details

func (strat S3SaveStrategy) Save(env Envelope, req *request.Request) error

Save will save the envelope contents to s3.



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// File 'service/s3/s3crypto/strategy.go', line 27

func (strat S3SaveStrategy) Save(env Envelope, req *request.Request) error { input := req.Params.(*s3.PutObjectInput) b, err := json.Marshal(env) if err != nil { return err } instInput := s3.PutObjectInput{ Bucket: input.Bucket, Body: bytes.NewReader(b), } if strat.InstructionFileSuffix == "" { instInput.Key = aws.String(*input.Key + DefaultInstructionKeySuffix) } else { instInput.Key = aws.String(*input.Key + strat.InstructionFileSuffix) } _, err = strat.Client.PutObject(&instInput) return err }