Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache 结构体 Cache struct
func NewCache ¶
func NewCache() *Cache
NewCache 函数创建并返回一个新的 Cache 实例 The NewCache function creates and returns a new Cache instance
func (*Cache) Cleanup ¶
Cleanup 方法遍历 Cache 中的所有键值对,并对每个值执行给定的函数,然后删除该键值对 The Cleanup method traverses all key-value pairs in Cache, performs the given function on each value, and then deletes the key-value pair
func (*Cache) Count ¶
Count 方法返回 Cache 中的键值对数量 The Count method returns the number of key-value pairs in Cache
type Segment ¶
type Segment struct {
// contains filtered or unexported fields
}
Segment 结构体 Segment struct
func NewSegment ¶
func NewSegment() *Segment
NewSegment 函数创建并返回一个新的 Segment 实例 The NewSegment function creates and returns a new Segment instance
func (*Segment) Cleanup ¶
Cleanup 方法遍历 storage 中的所有键值对,并对每个值执行给定的函数,然后删除该键值对 The Cleanup method traverses all key-value pairs in storage, performs the given function on each value, and then deletes the key-value pair
func (*Segment) Count ¶
Count 方法返回 storage 中的键值对数量 The Count method returns the number of key-value pairs in storage
func (*Segment) Delete ¶
Delete 方法从 storage 中删除给定的键 The Delete method deletes the given key from storage