clientcache

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package clientcache provides support for caching requests as a client

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	SetEntry(key string, value interface{}, costWeight float32, ttl time.Duration) error
	UnsetEntry(key string)
	SetNonexistentEntry(key string, cost float32, ttl time.Duration)
	GetEntry(key string, value interface{}) (bool, bool, error)
}

func NewRistrettoCache

func NewRistrettoCache(cacheConfig ristretto.Config) (Cache, error)

type RistrettoCache

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

func (*RistrettoCache) GetEntry

func (c *RistrettoCache) GetEntry(key string, value interface{}) (bool, bool, error)

func (*RistrettoCache) SetEntry

func (c *RistrettoCache) SetEntry(
	key string, value interface{}, costWeight float32, ttl time.Duration,
) error

func (*RistrettoCache) SetNonexistentEntry

func (c *RistrettoCache) SetNonexistentEntry(key string, cost float32, ttl time.Duration)

func (*RistrettoCache) UnsetEntry

func (c *RistrettoCache) UnsetEntry(key string)

Jump to

Keyboard shortcuts

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