lru

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemoryStorage added in v1.0.1

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

func NewInMemory added in v1.5.0

func NewInMemory(
	ctx context.Context,
	cfg config.Config,
	upstream upstream.Upstream,
	shardedMap *sharded.Map[*model.Entry],
) *InMemoryStorage

func (*InMemoryStorage) Clear added in v1.0.1

func (s *InMemoryStorage) Clear()

func (*InMemoryStorage) Close added in v1.1.1

func (s *InMemoryStorage) Close() error

func (*InMemoryStorage) Get added in v1.0.1

func (s *InMemoryStorage) Get(req *model.Entry) (*model.Entry, bool)

func (*InMemoryStorage) GetByKey added in v1.8.0

func (s *InMemoryStorage) GetByKey(key uint64) (*model.Entry, bool)

func (*InMemoryStorage) Len added in v1.0.1

func (s *InMemoryStorage) Len() int64

func (*InMemoryStorage) Mem added in v1.0.1

func (s *InMemoryStorage) Mem() int64

func (*InMemoryStorage) OnTTL added in v1.7.0

func (s *InMemoryStorage) OnTTL(entry *model.Entry) error

func (*InMemoryStorage) PeekExpiredTTL added in v1.7.0

func (s *InMemoryStorage) PeekExpiredTTL() (*model.Entry, bool)

func (*InMemoryStorage) Remove added in v1.0.1

func (s *InMemoryStorage) Remove(entry *model.Entry) (int64, bool)

func (*InMemoryStorage) Set added in v1.0.1

func (s *InMemoryStorage) Set(new *model.Entry) (persisted bool)

func (*InMemoryStorage) SoftEvictUntilWithinLimit added in v1.6.0

func (s *InMemoryStorage) SoftEvictUntilWithinLimit(backoff int64) (freed, evicted int64)

func (*InMemoryStorage) SoftMemoryLimitOvercome added in v1.6.0

func (s *InMemoryStorage) SoftMemoryLimitOvercome() bool

func (*InMemoryStorage) Stat added in v1.0.1

func (s *InMemoryStorage) Stat() (bytes int64, length int64)

func (*InMemoryStorage) WalkShards added in v1.0.1

func (s *InMemoryStorage) WalkShards(ctx context.Context, fn func(key uint64, shard *sharded.Shard[*model.Entry]))

Jump to

Keyboard shortcuts

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