lru

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2025 License: Apache-2.0 Imports: 12 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,
	meter metrics.Meter,
	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) EvictN added in v1.5.0

func (s *InMemoryStorage) EvictN(n, shardSample, entriesSample int) (freedBytes, items int64)

func (*InMemoryStorage) Get added in v1.0.1

func (s *InMemoryStorage) Get(req *model.Entry) (*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) Rand added in v1.0.1

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

func (*InMemoryStorage) Refresh added in v1.5.0

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

func (*InMemoryStorage) Remove added in v1.0.1

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

func (*InMemoryStorage) ScanOutdatedN added in v1.5.0

func (s *InMemoryStorage) ScanOutdatedN(dst []*model.Entry, shardSample, entrySample int) (out []*model.Entry, found int)

func (*InMemoryStorage) Set added in v1.0.1

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

func (*InMemoryStorage) ShouldEvictHard added in v1.5.0

func (s *InMemoryStorage) ShouldEvictHard() (diffBytes int64, should bool)

func (*InMemoryStorage) ShouldEvictSoft added in v1.5.0

func (s *InMemoryStorage) ShouldEvictSoft() (diffBytes int64, should 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