cache

package
v2.0.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: MIT Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCache

func NewCache(js jconf.SubConfig) (cache rproxymod.Cache, err error)

Types

type CacheConfig

type CacheConfig struct {
	Type   string
	Config *jconf.OptionalSubConfig `json:",omitempty"`
}

type NullCache

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

func NewNullCache

func NewNullCache() (cacher *NullCache)

func (*NullCache) Clear

func (nc *NullCache) Clear()

func (*NullCache) Close

func (nc *NullCache) Close() error

func (*NullCache) Delete

func (nc *NullCache) Delete(key []byte)

func (*NullCache) Get

func (nc *NullCache) Get(key []byte) (value []byte, err error)

func (*NullCache) GetAndStore

func (nc *NullCache) GetAndStore(key []byte, fetcher rproxymod.CacheFetcher) (value []byte, err error)

func (*NullCache) GetCacheStats

func (nc *NullCache) GetCacheStats() (stats *rproxymod.CacheStats)

func (*NullCache) Set

func (nc *NullCache) Set(key []byte, value []byte, ttl time.Duration) error

type YbcCache

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

Cache imlementation based on 'valyala/ybc' library.

func NewYbcCache

func NewYbcCache(cfg jconf.SubConfig) (cacher *YbcCache, err error)

func (*YbcCache) Clear

func (yc *YbcCache) Clear()

func (*YbcCache) Close

func (yc *YbcCache) Close() error

func (*YbcCache) Delete

func (yc *YbcCache) Delete(key []byte)

func (*YbcCache) Get

func (yc *YbcCache) Get(key []byte) (value []byte, err error)

func (*YbcCache) GetAndStore

func (yc *YbcCache) GetAndStore(key []byte, fetcher rproxymod.CacheFetcher) (value []byte, err error)

func (*YbcCache) GetCacheStats

func (yc *YbcCache) GetCacheStats() (stats *rproxymod.CacheStats)

func (*YbcCache) Set

func (yc *YbcCache) Set(key []byte, value []byte, ttl time.Duration) error

type YbcConfig

type YbcConfig struct {
	MaxItemSize   int
	MaxItemsCount int
}

Jump to

Keyboard shortcuts

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