Documentation
¶
Index ¶
- Variables
- func HashKey(key []byte) uint64
- type Cache
- func (this *Cache) Clean()
- func (this *Cache) Count() (count int)
- func (this *Cache) Delete(key string)
- func (this *Cache) Destroy()
- func (this *Cache) GC()
- func (this *Cache) IncreaseInt64(key string, delta int64, expiredAt int64, extend bool) int64
- func (this *Cache) Read(key string) (item *Item)
- func (this *Cache) Write(key string, value any, expiredAt int64) (ok bool)
- type Item
- type Manager
- type MaxItemsOption
- type OptionInterface
- type Piece
- func (this *Piece) Add(key uint64, item *Item) (ok bool)
- func (this *Piece) Clean()
- func (this *Piece) Count() (count int)
- func (this *Piece) Delete(key uint64)
- func (this *Piece) Destroy()
- func (this *Piece) GC()
- func (this *Piece) IncreaseInt64(key uint64, delta int64, expiredAt int64, extend bool) (result int64)
- func (this *Piece) Read(key uint64) (item *Item)
- type PiecesOption
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache TTL缓存 最大的缓存时间为30 * 86400 Piece数据结构:
Piece1 | Piece2 | Piece3 | ... [ Item1, Item2, ... ] | ...
func NewBigCache ¶ added in v1.1.0
func NewBigCache() *Cache
func NewCache ¶
func NewCache(opt ...OptionInterface) *Cache
func (*Cache) IncreaseInt64 ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager() *Manager
type MaxItemsOption ¶
type MaxItemsOption struct {
Count int
}
func NewMaxItemsOption ¶
func NewMaxItemsOption(count int) *MaxItemsOption
type OptionInterface ¶
type OptionInterface interface { }
type Piece ¶
type Piece struct {
// contains filtered or unexported fields
}
func (*Piece) IncreaseInt64 ¶
type PiecesOption ¶
type PiecesOption struct {
Count int
}
func NewPiecesOption ¶
func NewPiecesOption(count int) *PiecesOption
Click to show internal directories.
Click to hide internal directories.