Help us shape the future of Go! Take the 2026 Go Developer Survey

types

package
v1.6.49 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 4 Imported by: 23

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyIndex added in v1.6.47

type KeyIndex struct {
	StoredAt      time.Time   `json:"stored"`
	FreshTime     time.Time   `json:"fresh"`
	StaleTime     time.Time   `json:"stale"`
	VariedHeaders http.Header `json:"varied"`
	Etag          string      `json:"etag"`
	RealKey       string      `json:"realKey"`
}

type StorageMapper added in v1.6.47

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

type Storer

type Storer interface {
	MapKeys(prefix string) map[string]string
	ListKeys() []string
	Prefix(key string) []string
	Get(key string) []byte
	Set(key string, value []byte, url configurationtypes.URL, duration time.Duration) error
	Delete(key string)
	DeleteMany(key string)
	Init() error
	Name() string
	Reset() error

	// Multi level storer to handle fresh/stale at once
	GetMultiLevel(key string, req *http.Request, validator *rfc.Revalidator) (fresh *http.Response, stale *http.Response)
	SetMultiLevel(baseKey, variedKey string, value []byte, variedHeaders http.Header, etag string, duration time.Duration, realKey string) error
}

Jump to

Keyboard shortcuts

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