auth/vendor/github.com/lestrrat-go/httpcc
Maxim Lebedev dcf9e3c2ca
continuous-integration/drone/push Build is failing Details
📌 Vendored dependencies
2022-06-09 22:35:23 +05:00
..
.gitignore 📌 Vendored dependencies 2022-06-09 22:35:23 +05:00
LICENSE 📌 Vendored dependencies 2022-06-09 22:35:23 +05:00
README.md 📌 Vendored dependencies 2022-06-09 22:35:23 +05:00
directives.go 📌 Vendored dependencies 2022-06-09 22:35:23 +05:00
httpcc.go 📌 Vendored dependencies 2022-06-09 22:35:23 +05:00

README.md

httpcc

Parses HTTP/1.1 Cache-Control header, and returns a struct that is convenient
for the end-user to do what they will with.

Parsing the HTTP Request

dir, err := httpcc.ParseRequest(req.Header.Get(`Cache-Control`))
// dir.MaxAge()       uint64, bool
// dir.MaxStale()     uint64, bool
// dir.MinFresh()     uint64, bool
// dir.NoCache()      bool
// dir.NoStore()      bool
// dir.NoTransform()  bool
// dir.OnlyIfCached() bool
// dir.Extensions()   map[string]string

Parsing the HTTP Response

directives, err := httpcc.ParseResponse(res.Header.Get(`Cache-Control`))
// dir.MaxAge()         uint64, bool
// dir.MustRevalidate() bool
// dir.NoCache()        []string
// dir.NoStore()        bool
// dir.NoTransform()    bool
// dir.Public()         bool
// dir.Private()        bool
// dir.SMaxAge()        uint64, bool
// dir.Extensions()     map[string]string