lruKit

package
v3.0.918 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCache

func NewCache[K comparable, V any](size int) (*lru.Cache[K, V], error)

NewCache 缓存(不带TTL).

func NewExpirableCache

func NewExpirableCache[K comparable, V any](size int, onEvict expirable.EvictCallback[K, V], ttl time.Duration) *expirable.LRU[K, V]

NewExpirableCache 缓存(带TTL).

@param size (1) 缓存大小(max keys)

(2) 0: unlimited size

@param ttl Providing 0 TTL turns expiring off.

Types

This section is empty.

Jump to

Keyboard shortcuts

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