storage

package
v0.0.0-...-2ba2e4a Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Factory

Factory function create new Default instance

Types

type Default

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

Default provider type

func (*Default) Delete

func (provider *Default) Delete(key string)

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

func (*Default) DeleteMany

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

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

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

func (*Default) GetMultiLevel

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

func (provider *Default) Init() error

Init method will

func (*Default) ListKeys

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

ListKeys method returns the list of existing keys

func (*Default) MapKeys

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

MapKeys method returns a map with the key and value

func (*Default) Name

func (provider *Default) Name() string

Name returns the storer name

func (*Default) Reset

func (provider *Default) Reset() error

Reset method will reset or close provider

func (*Default) Set

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

Set method will store the response in Badger provider

func (*Default) SetMultiLevel

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

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