Documentation
¶
Overview ¶
Package cache 是 data 门面子包:缓存域——接口(Cache/CacheAside/SourceFunc)+ 本地缓存(LocalCache/SingleFlightCache)+ 缓存键构造 + Checker。实现在 pkg/cache。
re-export 自 github.com/oekit/pkg/cache:类型为泛型 type alias(与源包**完全同一类型**, 双向赋值互通);非泛型函数/变量经 var 引用同一函数值。源包新增导出符号时 本壳需同步(门面跟版税,data 门面化决策已接受)。
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var HashKey = src.HashKey
View Source
var Key = src.Key
View Source
var NewChecker = src.NewChecker
View Source
var TenantKey = src.TenantKey
View Source
var UserKey = src.UserKey
View Source
var WithClock = src.WithClock
Functions ¶
This section is empty.
Types ¶
type CacheAside ¶
type CacheAside[T any] = src.CacheAside[T]
type LocalCache ¶
type LocalCache[T any] = src.LocalCache[T]
func NewLocalCache ¶
func NewLocalCache[T any](cfg LocalConfig[T]) *LocalCache[T]
NewLocalCache 创建本地缓存(泛型函数无法 var re-export,经包装转发)。
type LocalConfig ¶
type LocalConfig[T any] = src.LocalConfig[T]
type SingleFlightCache ¶
type SingleFlightCache[T any] = src.SingleFlightCache[T]
func NewSingleFlightCache ¶
func NewSingleFlightCache[T any](inner CacheAside[T]) *SingleFlightCache[T]
NewSingleFlightCache 创建并发回源合并装饰器。
type SourceFunc ¶
type SourceFunc[T any] = src.SourceFunc[T]
Click to show internal directories.
Click to hide internal directories.