Documentation
¶
Overview ¶
Example ¶
package main
import (
"fmt"
"net/http"
"github.com/go-http-utils/fresh"
)
func main() {
reqHeader, resHeader := make(http.Header), make(http.Header)
reqHeader.Set("if-none-match", "foo")
resHeader.Set("etag", "bar")
fmt.Println(fresh.IsFresh(reqHeader, resHeader))
// -> false
reqHeader, resHeader = make(http.Header), make(http.Header)
reqHeader.Set("if-modified-since", "Mon, 14 Nov 2016 22:05:49 GMT")
resHeader.Set("last-modified", "Mon, 14 Nov 2016 22:05:47 GMT")
fmt.Println(fresh.IsFresh(reqHeader, resHeader))
// -> true
}
Index ¶
Examples ¶
Constants ¶
View Source
const Version = "0.4.0"
Version is this package's verison
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.