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

Method SetKeyStartsWith

post-policy.go:106–117  ·  view source on GitHub ↗

SetKeyStartsWith - Sets an object name that an policy based upload can start with. Can use an empty value ("") to allow any key.

(keyStartsWith string)

Source from the content-addressed store, hash-verified

104// can start with.
105// Can use an empty value ("") to allow any key.
106func (p *PostPolicy) SetKeyStartsWith(keyStartsWith string) error {
107 policyCond := policyCondition{
108 matchType: "starts-with",
109 condition: "$key",
110 value: keyStartsWith,
111 }
112 if err := p.addNewPolicy(policyCond); err != nil {
113 return err
114 }
115 p.formData["key"] = keyStartsWith
116 return nil
117}
118
119// SetBucket - Sets bucket at which objects will be uploaded to.
120func (p *PostPolicy) SetBucket(bucketName string) error {

Callers 1

Calls 1

addNewPolicyMethod · 0.95

Tested by 1