knutsel commented on a change in pull request #2246: Add HitCount and FreshFor
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/2246#discussion_r188269492
 
 

 ##########
 File path: grove/web/util.go
 ##########
 @@ -198,3 +200,145 @@ func ParseHTTPDate(d string) (time.Time, bool) {
 
 // RemapTextKey is the plugin shared data key inserted by grovetccfg for the 
Remap Line of the Delivery Service in Traffic Control, Traffic Ops.
 const RemapTextKey = "remap_text"
+
+const Day = time.Hour * time.Duration(24)
+
+// GetHTTPDeltaSeconds is a helper function which gets an HTTP Delta Seconds 
from the given map (which is typically a `http.Header` or `CacheControl`. 
Returns false if the given key doesn't exist in the map, or if the value isn't 
a valid Delta Seconds per RFC2616ยง3.3.2.
+func GetHTTPDeltaSeconds(m map[string][]string, key string) (time.Duration, 
bool) {
 
 Review comment:
   I needed it outside the package, and it was lowercase in rules.go. I read 
rules as in remap-rules, not rfc-rules... So I thought web would be a better 
package, because I thought they're more general than remap-rules... +1 on 
making it's own package, want me to give that a try? What would you like to 
call it? 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to