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

 ##########
 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:
   How about `rfc`? Can you add a Godoc package-level comment too, along the 
lines of
   
   ```
   // Package rfc contains functions implementing RFC 7234, 2616, and other RFCs
   // When changing functions, be sure they still conform to the corresponding 
RFC.
   // When adding symbols, document the RFC and section they correspond to.
   package rfc
   ```
   

----------------------------------------------------------------
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