ristretto

package
v1.217.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Get(key any) (any, bool)
	Set(key, value any, cost int64) bool
	SetWithTTL(key, value any, cost int64, ttl time.Duration) bool
	Del(key any)
	GetTTL(key any) (time.Duration, bool)
	Close()

	Hits() uint64
	Misses() uint64
}

Cache for ristretto.

type NoopCache

type NoopCache struct{}

NoopCache for ristretto.

func NewNoopCache

func NewNoopCache() *NoopCache

NewNoopCache for ristretto.

func (*NoopCache) Close

func (*NoopCache) Close()

func (*NoopCache) Del

func (*NoopCache) Del(_ any)

func (*NoopCache) Get

func (*NoopCache) Get(_ any) (any, bool)

func (*NoopCache) GetTTL

func (*NoopCache) GetTTL(_ any) (time.Duration, bool)

func (*NoopCache) Hits

func (*NoopCache) Hits() uint64

func (*NoopCache) Misses

func (*NoopCache) Misses() uint64

func (*NoopCache) Set

func (*NoopCache) Set(_, _ any, _ int64) bool

func (*NoopCache) SetWithTTL

func (*NoopCache) SetWithTTL(_, _ any, _ int64, _ time.Duration) bool

Jump to

Keyboard shortcuts

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