storage

package
v1.6.50 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VarySeparator          = "{-VARY-}"
	DecodedHeaderSeparator = ";"

	StalePrefix = "STALE_"
)

Variables

This section is empty.

Functions

func CacheConnectionFactory

func CacheConnectionFactory(c t.AbstractConfigurationInterface) (types.Storer, error)

CacheConnectionFactory function create new Cache instance

Types

type Cache

type Cache struct {
	*cache.Cache
	// contains filtered or unexported fields
}

Cache provider type

func (*Cache) Delete

func (provider *Cache) Delete(key string)

Delete method will delete the response in Cache provider if exists corresponding to key param

func (*Cache) DeleteMany

func (provider *Cache) DeleteMany(key string)

DeleteMany method will delete the responses in Cache provider if exists corresponding to the regex key param

func (*Cache) Get

func (provider *Cache) Get(key string) []byte

Get method returns the populated response if exists, empty response then

func (*Cache) Init

func (provider *Cache) Init() error

Init method will

func (*Cache) ListKeys

func (provider *Cache) ListKeys() []string

ListKeys method returns the list of existing keys

func (*Cache) MapKeys

func (provider *Cache) MapKeys(prefix string) map[string]string

MapKeys method returns the map of existing keys

func (*Cache) Name

func (provider *Cache) Name() string

Name returns the storer name

func (*Cache) Prefix

func (provider *Cache) Prefix(key string, req *http.Request, validator *rfc.Revalidator) *http.Response

Prefix method returns the populated response if exists, empty response then

func (*Cache) Reset

func (provider *Cache) Reset() error

Reset method will reset or close provider

func (*Cache) Set

func (provider *Cache) Set(key string, value []byte, duration time.Duration) error

Set method will store the response in Cache provider

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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