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

Function isValidExpiry

utils.go:191–200  ·  view source on GitHub ↗

Verify if input expires value is valid.

(expires time.Duration)

Source from the content-addressed store, hash-verified

189
190// Verify if input expires value is valid.
191func isValidExpiry(expires time.Duration) error {
192 expireSeconds := int64(expires / time.Second)
193 if expireSeconds < 1 {
194 return errInvalidArgument("Expires cannot be lesser than 1 second.")
195 }
196 if expireSeconds > 604800 {
197 return errInvalidArgument("Expires cannot be greater than 7 days.")
198 }
199 return nil
200}
201
202// Extract only necessary metadata header key/values by
203// filtering them out with a list of custom header keys.

Callers 2

TestIsValidExpiryFunction · 0.85
presignURLMethod · 0.85

Calls 1

errInvalidArgumentFunction · 0.85

Tested by 1

TestIsValidExpiryFunction · 0.68