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

Function amzExpirationToExpiryDateRuleID

utils.go:55–64  ·  view source on GitHub ↗
(expiration string)

Source from the content-addressed store, hash-verified

53var expirationRegex = regexp.MustCompile(`expiry-date="(.*?)", rule-id="(.*?)"`)
54
55func amzExpirationToExpiryDateRuleID(expiration string) (time.Time, string) {
56 if matches := expirationRegex.FindStringSubmatch(expiration); len(matches) == 3 {
57 expTime, err := parseRFC7231Time(matches[1])
58 if err != nil {
59 return time.Time{}, ""
60 }
61 return expTime, matches[2]
62 }
63 return time.Time{}, ""
64}
65
66var restoreRegex = regexp.MustCompile(`ongoing-request="(.*?)"(, expiry-date="(.*?)")?`)
67

Callers 4

CopyObjectMethod · 0.85
ToObjectInfoFunction · 0.85
putObjectDoMethod · 0.85

Calls 1

parseRFC7231TimeFunction · 0.85

Tested by

no test coverage detected