Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CacheIndex ¶
type CacheIndex interface { }
func NewCacheIndex ¶
func NewCacheIndex(redis Rediser) CacheIndex
type LocalCache ¶
type RedisLock ¶
type RedisLock interface { // 加锁, 返回加锁是否成功 TryLock(key string, val interface{}, ttl time.Duration, ctx context.Context) (bool, []byte, error) // 解锁 UnLock(ctx context.Context, key string, val interface{}) error // 等待释放锁 WaitUnLock(ctx context.Context, key string) (err error) // 续约 RenewLock(ctx context.Context, key string, value interface{}, ttl time.Duration) (err error) // 加锁, 如果有锁,等待锁释放再添加锁 WaitLock(key string, val interface{}, ttl time.Duration, ctx context.Context) (bool, error) }
func NewRedisLock ¶
type TinyLFU ¶
type TinyLFU struct {
// contains filtered or unexported fields
}
func (*TinyLFU) UseRandomizedTTL ¶
Click to show internal directories.
Click to hide internal directories.