cache

package
v0.0.0-...-ed6b86b Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

LocalCache 基于github.com/patrickmn/go-cache的本地cache 默认key没有超时时间 默认的清理内存中超时key的时间间隔是1min

Functions

This section is empty.

Types

type LFUCache

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

func NewLFUCache

func NewLFUCache[K comparable, V any](capacity int) *LFUCache[K, V]

func (*LFUCache[K, V]) Get

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

func (*LFUCache[K, V]) Put

func (c *LFUCache[K, V]) Put(key K, value V)

type LRUCache

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

func NewLRUCache

func NewLRUCache[K comparable, T any](capacity int) *LRUCache[K, T]

func (*LRUCache[K, T]) Get

func (c *LRUCache[K, T]) Get(key K) (T, bool)

func (*LRUCache[K, T]) Put

func (c *LRUCache[K, T]) Put(key K, value T)

func (*LRUCache[K, T]) Size

func (c *LRUCache[K, T]) Size() int

Jump to

Keyboard shortcuts

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