etcd

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: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Factory

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

Factory function create new Etcd instance.

Types

type Etcd

type Etcd struct {
	*clientv3.Client
	// contains filtered or unexported fields
}

Etcd provider type.

func (*Etcd) Delete

func (provider *Etcd) Delete(key string)

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

func (*Etcd) DeleteMany

func (provider *Etcd) DeleteMany(key string)

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

func (*Etcd) Get

func (provider *Etcd) Get(key string) (item []byte)

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

func (*Etcd) GetMultiLevel

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

func (provider *Etcd) Init() error

Init method will.

func (*Etcd) ListKeys

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

ListKeys method returns the list of existing keys.

func (*Etcd) MapKeys

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

MapKeys method returns the map of existing keys.

func (*Etcd) Name

func (provider *Etcd) Name() string

Name returns the storer name.

func (*Etcd) Reconnect

func (provider *Etcd) Reconnect()

func (*Etcd) Reset

func (provider *Etcd) Reset() error

Reset method will reset or close provider.

func (*Etcd) Set

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

Set method will store the response in Etcd provider.

func (*Etcd) SetMultiLevel

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

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