Documentation
¶
Index ¶
- Variables
- func FastKey(data string) string
- func Key(prefix, data string) string
- func KeyWithContext(desensitizer, dataType, data string) string
- type CacheKey
- func (cko *CacheKey) ClearPrefixCache()
- func (cko *CacheKey) FastStringHash(s string) uint64
- func (cko *CacheKey) GenerateFastKey(data string) string
- func (cko *CacheKey) GenerateHashKey(data string) string
- func (cko *CacheKey) GenerateKey(prefix, data string) string
- func (cko *CacheKey) GenerateKeyWithContext(desensitizer, dataType, data string) string
- func (cko *CacheKey) GenerateLayeredKey(layers ...string) string
- func (cko *CacheKey) GetCacheStats() map[string]interface{}
- func (cko *CacheKey) HashCombine(hashes ...uint64) uint64
- func (cko *CacheKey) IsXXHashEnabled() bool
- func (cko *CacheKey) SetXXHashEnabled(enabled bool)
Constants ¶
This section is empty.
Variables ¶
View Source
var Global = New()
全局缓存键优化器实例(仅供内部模块复用)
Functions ¶
func KeyWithContext ¶
KeyWithContext 全局上下文键生成函数
Types ¶
type CacheKey ¶
type CacheKey struct {
// contains filtered or unexported fields
}
CacheKey 缓存键优化器
func (*CacheKey) FastStringHash ¶
FastStringHash 快速字符串哈希(内联优化版本)
func (*CacheKey) GenerateFastKey ¶
GenerateFastKey 生成快速键(平衡性能和碰撞率)
func (*CacheKey) GenerateHashKey ¶
GenerateHashKey 生成纯哈希键
func (*CacheKey) GenerateKey ¶
GenerateKey 生成优化的缓存键 使用 xxhash 算法生成高性能、低碰撞的缓存键
func (*CacheKey) GenerateKeyWithContext ¶
GenerateKeyWithContext 生成带上下文的缓存键
func (*CacheKey) GenerateLayeredKey ¶
GenerateLayeredKey 生成分层键
func (*CacheKey) GetCacheStats ¶
GetCacheStats 获取缓存优化器统计信息
func (*CacheKey) HashCombine ¶
HashCombine 组合多个哈希值
func (*CacheKey) IsXXHashEnabled ¶
IsXXHashEnabled 是否启用 xxhash
func (*CacheKey) SetXXHashEnabled ¶
SetXXHashEnabled 设置是否启用 xxhash
Click to show internal directories.
Click to hide internal directories.