Documentation ¶
Index ¶
Constants ¶
View Source
const ( ScopePublic = Scope("PUBLIC") ScopePrivate = Scope("PRIVATE") )
Variables ¶
This section is empty.
Functions ¶
func Middleware ¶
Middleware returns an instance of cachedServer.
Types ¶
type CacheControlExtension ¶
type CacheControlExtension struct { Version int `json:"version"` Hints []Hint `json:"hints"` // contains filtered or unexported fields }
func CacheControl ¶
func CacheControl(ctx context.Context) *CacheControlExtension
func (*CacheControlExtension) AddHint ¶
func (cache *CacheControlExtension) AddHint(h Hint)
func (*CacheControlExtension) OverallPolicy ¶
func (cache *CacheControlExtension) OverallPolicy() OverallCachePolicy
OverallPolicy return a calculated cache policy
type Extension ¶
type Extension struct{}
func (Extension) ExtensionName ¶
func (Extension) InterceptResponse ¶
type OverallCachePolicy ¶
func GetOverallCachePolicy ¶
func GetOverallCachePolicy(cache *CacheControlExtension) (OverallCachePolicy, bool)
GetOverallCachePolicy is responsible to extract cache policy from a Response. If does not have any cacheControl in Extensions, it will return (empty, false)
Click to show internal directories.
Click to hide internal directories.