rfc

package
v1.7.5 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MappingElection added in v1.7.3

func MappingElection(provider types.Storer, item []byte, req *http.Request, validator *types.Revalidator) (resultFresh *http.Response, resultStale *http.Response, e error)

func MappingUpdater added in v1.7.3

func MappingUpdater(key string, item []byte, now, freshTime, staleTime time.Time, variedHeaders http.Header, etag, realKey string) (val []byte, e error)

func ParseRequest

func ParseRequest(req *http.Request) *types.Revalidator

func ValidateETagFromHeader

func ValidateETagFromHeader(etag string, validator *types.Revalidator)

Types

type KeyIndex added in v1.7.3

type KeyIndex struct {
	StoredAt      time.Time           `json:"stored_at,omitempty"`
	FreshTime     time.Time           `json:"fresh_time,omitempty"`
	StaleTime     time.Time           `json:"stale_time,omitempty"`
	VariedHeaders map[string][]string `json:"varied_headers,omitempty"`
	Etag          string              `json:"etag,omitempty"`
	RealKey       string              `json:"real_key,omitempty"`
}

type StorageMapper added in v1.7.3

type StorageMapper struct {
	Mapping map[string]*KeyIndex `json:"mapping,omitempty"`
}

func DecodeMapping added in v1.7.3

func DecodeMapping(item []byte) (*StorageMapper, error)

Jump to

Keyboard shortcuts

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