olric

package module
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Factory

func Factory(olricConfiguration core.CacheProvider, logger core.Logger, stale time.Duration) (core.Storer, error)

Factory function create new Olric instance.

Types

type Olric

type Olric struct {
	*olric.ClusterClient
	// contains filtered or unexported fields
}

Olric provider type.

func (*Olric) Delete

func (provider *Olric) Delete(key string)

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

func (*Olric) DeleteMany

func (provider *Olric) DeleteMany(key string)

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

func (*Olric) Get

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

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

func (*Olric) GetMultiLevel

func (provider *Olric) 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 (*Olric) Init

func (provider *Olric) Init() error

Init method will initialize Olric provider if needed.

func (*Olric) ListKeys

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

ListKeys method returns the list of existing keys.

func (*Olric) MapKeys

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

MapKeys method returns the map of existing keys.

func (*Olric) Name

func (provider *Olric) Name() string

Name returns the storer name.

func (*Olric) Reconnect

func (provider *Olric) Reconnect()

func (*Olric) Reset

func (provider *Olric) Reset() error

Reset method will reset or close provider.

func (*Olric) Set

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

Set method will store the response in Olric provider.

func (*Olric) SetMultiLevel

func (provider *Olric) 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 (*Olric) Uuid added in v0.0.4

func (provider *Olric) Uuid() string

Uuid returns an unique identifier.

Directories

Path Synopsis
caddy module

Jump to

Keyboard shortcuts

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