(expiration string)
| 53 | var expirationRegex = regexp.MustCompile(`expiry-date="(.*?)", rule-id="(.*?)"`) |
| 54 | |
| 55 | func 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 | |
| 66 | var restoreRegex = regexp.MustCompile(`ongoing-request="(.*?)"(, expiry-date="(.*?)")?`) |
| 67 |
no test coverage detected