storage

package
v0.0.0-...-d399288 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StalePrefix = "STALE_"

	MappingKeyPrefix = "IDX_"
)

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) GetMultiLevel

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

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) []string

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, url t.URL, duration time.Duration) error

Set method will store the response in Cache provider

func (*Cache) SetMultiLevel

func (provider *Cache) SetMultiLevel(baseKey, variedKey string, value []byte, variedHeaders http.Header, etag string, duration time.Duration, realKey string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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