# lrucache **Repository Path**: chenqinyu/lrucache ## Basic Information - **Project Name**: lrucache - **Description**: No description available - **Primary Language**: Go - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2021-03-07 - **Last Updated**: 2022-02-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # lrucache #### 介绍 lru协议缓存,支持高可用,高并发的缓存模块。 #### 软件架构 go 语言实现 lru 协议缓存模块 #### 使用说明 1. 基本节点使用方法 ``` cache := New(NewConfig(Shards:4, GCInterval:1, MaxKey:1000, SetChanSize:1024))> cache.SetWithRemove("hello1", "world", 1) cache.SetWithRemove("hello2", "world", 1) cache.SetWithRemove("hello3", "world", 3) time.Sleep(time.Second * 60) fmt.Println(cache.Get("hello1")) fmt.Println(cache.Get("hello2")) fmt.Println(cache.Get("hello3")) ``` #### 使用场景 分布式节点缓存,定时清理过期节点。保持内存的可用性