httpcache: github.com/GeekyPanda/httpcache/ruleset Index | Files

package ruleset

import "github.com/GeekyPanda/httpcache/ruleset"

Package ruleset provides the basics rules which are being extended bynethttp's and fhttp's rules.

Index

Package Files

ruleset.go

Variables

var (
    AuthorizationRule = func(header GetHeader) bool {
        return header("Authorization") == "" &&
            header("Proxy-Authenticate") == ""
    }

    MustRevalidateRule = func(header GetHeader) bool {
        return header("Must-Revalidate") == ""
    }

    ZeroMaxAgeRule = func(header GetHeader) bool {
        return header("S-Maxage") != "0" &&
            header("Max-Age") != "0"
    }

    NoCacheRule = func(header GetHeader) bool {
        return header("No-Cache") != "true"
    }
)

The shared header-mostly rules for both nethttp and fasthttp

var EmptyHeaderPredicate = func(GetHeader) bool {
    return true
}

EmptyHeaderPredicate returns always true

type GetHeader Uses

type GetHeader func(string) string

GetHeader is a type of func which receives a func of string which returns a string used to get headers values, both request's and response's.

type HeaderPredicate Uses

type HeaderPredicate func(GetHeader) bool

HeaderPredicate is a type of func which receives a func of string which returns a string and a boolean, used to get headers values, both request's and response's.

Updated 2017-04-12. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).