cacherules

package
v0.0.0-...-4e12403 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Between

type Between []int

func (Between) From

func (b Between) From() int

func (Between) To

func (b Between) To() int

type InternalRules

type InternalRules struct {
	// Request related
	NoReqExt            []string
	NoReqPathPrefix     []string
	NoReqPathSuffix     []string
	NoReqPathContains   []string
	NoReqCookieContains []string
	NoReqHeaders        map[string]string

	// Headers that condition the cache, blacklist
	RespHeadersBlackList map[string][]string

	RespContentTypeTTL       map[string]time.Duration
	RespContentTypeTTLString map[string]string
	RespStatusCodeTTL        map[int]time.Duration
	RespStatusCodeTTLString  map[string]string
}

func (*InternalRules) IsReqCachable

func (ir *InternalRules) IsReqCachable(req *http.Request) (ok bool, refresh bool)

func (*InternalRules) IsRespCachable

func (ir *InternalRules) IsRespCachable(resp *http.Response) (ttl time.Duration, ok bool)

func (*InternalRules) Parse

func (ir *InternalRules) Parse() error

Parse will read the string values and convert to time.Duration

type Rules

type Rules struct {
	InternalRules
	Domain map[string]InternalRules
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL