storage

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: MIT Imports: 10 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Factory added in v1.6.50

Factory function create new Default instance

Types

type Default added in v1.6.50

type Default struct {
	// contains filtered or unexported fields
}

Default provider type

func (*Default) Delete added in v1.6.50

func (provider *Default) Delete(key string)

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

func (*Default) DeleteMany added in v1.6.50

func (provider *Default) DeleteMany(key string)

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

func (*Default) Get added in v1.6.50

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

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

func (*Default) GetMultiLevel added in v1.6.50

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

GetMultiLevel tries to load the key and check if one of linked keys is a fresh/stale candidate.

func (*Default) Init added in v1.6.50

func (provider *Default) Init() error

Init method will

func (*Default) ListKeys added in v1.6.50

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

ListKeys method returns the list of existing keys

func (*Default) MapKeys added in v1.6.50

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

MapKeys method returns a map with the key and value

func (*Default) Name added in v1.6.50

func (provider *Default) Name() string

Name returns the storer name

func (*Default) Reset added in v1.6.50

func (provider *Default) Reset() error

Reset method will reset or close provider

func (*Default) Set added in v1.6.50

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

Set method will store the response in Badger provider

func (*Default) SetMultiLevel added in v1.6.50

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

SetMultiLevel tries to store the key with the given value and update the mapping key to store metadata.

func (*Default) Uuid added in v1.6.50

func (provider *Default) Uuid() string

Uuid returns an unique identifier

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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