MCPcopy
hub / github.com/minio/minio-go / SetBucket

Method SetBucket

post-policy.go:120–134  ·  view source on GitHub ↗

SetBucket - Sets bucket at which objects will be uploaded to.

(bucketName string)

Source from the content-addressed store, hash-verified

118
119// SetBucket - Sets bucket at which objects will be uploaded to.
120func (p *PostPolicy) SetBucket(bucketName string) error {
121 if strings.TrimSpace(bucketName) == "" {
122 return errInvalidArgument("Bucket name is empty.")
123 }
124 policyCond := policyCondition{
125 matchType: "eq",
126 condition: "$bucket",
127 value: bucketName,
128 }
129 if err := p.addNewPolicy(policyCond); err != nil {
130 return err
131 }
132 p.formData["bucket"] = bucketName
133 return nil
134}
135
136// SetCondition - Sets condition for credentials, date and algorithm
137func (p *PostPolicy) SetCondition(matchType, condition, value string) error {

Callers 6

PutObjectFanOutMethod · 0.95
TestPostPolicySetBucketFunction · 0.95
testPresignedPostPolicyFunction · 0.95
mainFunction · 0.95

Calls 2

addNewPolicyMethod · 0.95
errInvalidArgumentFunction · 0.85

Tested by 1

TestPostPolicySetBucketFunction · 0.76