ristretto

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(ristretto *Ristretto)

Option - Option types for cache

func MaxCost added in v0.3.1

func MaxCost(n string) Option

MaxCost - Defines maximum cost for ristretto

func NumberOfCounters added in v0.3.1

func NumberOfCounters(n int64) Option

NumberOfCounters - Number of keys to track frequency.

type Ristretto

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

Ristretto - Structure for Ristretto

func New

func New(opts ...Option) (*Ristretto, error)

New - Creates new ristretto cache

func (*Ristretto) Close added in v0.3.8

func (r *Ristretto) Close()

Close - Closes cache

func (*Ristretto) Get added in v0.3.8

func (r *Ristretto) Get(key interface{}) (interface{}, bool)

Get - Gets value from cache

func (*Ristretto) Set added in v0.3.8

func (r *Ristretto) Set(key, value interface{}, cost int64) bool

Set - Sets value to cache

func (*Ristretto) Wait added in v0.3.8

func (r *Ristretto) Wait()

Wait - Waits for cache to be ready

Jump to

Keyboard shortcuts

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