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