cache

package
v0.0.0-...-fe58d70 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ShardCache

type ShardCache[K string | gokit.Number, V any] struct {
	// contains filtered or unexported fields
}

ShardCache 定义分片缓存的数据结构

func New

func New[K string | gokit.Number, V any]() *ShardCache[K, V]

New 创建一个分片的键值对缓存

分片数量:runtime.NumCPU() * 32

func (*ShardCache[K, V]) Delete

func (own *ShardCache[K, V]) Delete(key K)

Delete 删除数据

func (*ShardCache[K, V]) Load

func (own *ShardCache[K, V]) Load(key K) (V, bool)

Load 读取数据

func (*ShardCache[K, V]) Store

func (own *ShardCache[K, V]) Store(key K, value V)

Store 缓存数据

Jump to

Keyboard shortcuts

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