cache

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WithExpiration = cache.WithExpiration

Functions

This section is empty.

Types

type Cache

type Cache[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func NewLRUCache

func NewLRUCache[K comparable, V any](size int, metricName string) Cache[K, V]

func (*Cache[K, V]) Delete added in v1.2.0

func (c *Cache[K, V]) Delete(key K)

func (*Cache[K, V]) Get

func (c *Cache[K, V]) Get(key K) (V, bool)

func (*Cache[K, V]) Keys added in v1.1.0

func (c *Cache[K, V]) Keys() []K

Keys returns the keys of the cache. the order is relied on algorithms.

func (*Cache[K, V]) Set

func (c *Cache[K, V]) Set(key K, val V, opts ...cache.ItemOption)

Jump to

Keyboard shortcuts

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