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

Method SetKey

post-policy.go:87–101  ·  view source on GitHub ↗

SetKey - Sets an object name for the policy based upload.

(key string)

Source from the content-addressed store, hash-verified

85
86// SetKey - Sets an object name for the policy based upload.
87func (p *PostPolicy) SetKey(key string) error {
88 if strings.TrimSpace(key) == "" {
89 return errInvalidArgument("Object name is empty.")
90 }
91 policyCond := policyCondition{
92 matchType: "eq",
93 condition: "$key",
94 value: key,
95 }
96 if err := p.addNewPolicy(policyCond); err != nil {
97 return err
98 }
99 p.formData["key"] = key
100 return nil
101}
102
103// SetKeyStartsWith - Sets an object name that an policy based upload
104// can start with.

Callers 6

PutObjectFanOutMethod · 0.95
TestPostPolicySetKeyFunction · 0.95
testPresignedPostPolicyFunction · 0.95
mainFunction · 0.95

Calls 2

addNewPolicyMethod · 0.95
errInvalidArgumentFunction · 0.85

Tested by 1

TestPostPolicySetKeyFunction · 0.76