8000 GitHub - bwangelme/lru-cache
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

bwangelme/lru-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

LRU Cache

一个支持并发读取的 LRU (Least Recently Used) 缓存实现。

特性

  • 支持并发安全的读写
  • 实现 LRU 淘汰策略
  • 支持设置最大容量
  • 支持过期时间

使用示例

cache := New(100, 5*time.Minute)
cache.Set("key", "value")
value, exists := cache.Get("key")

运行测试

go test -v ./cache

运行示例

go run examples/main.go

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0