Documentation ¶
Index ¶
- Constants
- func HashKey(key []byte) uint64
- type Cell
- func (this *Cell) Delete(hashKey uint64)
- func (this *Cell) Increase64(key []byte, expireAt int64, hashKey uint64, delta int64) (result int64)
- func (this *Cell) Range(f func(item *Item))
- func (this *Cell) Read(hashKey uint64) *Item
- func (this *Cell) Recycle()
- func (this *Cell) Reset()
- func (this *Cell) Stat() *CellStat
- func (this *Cell) Trim()
- func (this *Cell) Write(hashKey uint64, item *Item)
- type CellStat
- type CompressOpt
- type Grid
- func (this *Grid) Cells() []*Cell
- func (this *Grid) Delete(key []byte)
- func (this *Grid) Destroy()
- func (this *Grid) IncreaseInt64(key []byte, delta int64, lifeSeconds int64) (result int64)
- func (this *Grid) Read(key []byte) *Item
- func (this *Grid) Reset()
- func (this *Grid) Stat() *Stat
- func (this *Grid) WriteBytes(key []byte, value []byte, lifeSeconds int64)
- func (this *Grid) WriteInt64(key []byte, value int64, lifeSeconds int64)
- func (this *Grid) WriteInterface(key []byte, value interface{}, lifeSeconds int64)
- func (this *Grid) WriteItem(item *Item)
- func (this *Grid) WriteString(key []byte, value string, lifeSeconds int64)
- type Item
- type ItemType
- type LimitCountOpt
- type LimitSizeOpt
- type List
- type RecycleIntervalOpt
- type Stat
Constants ¶
View Source
const ( ItemInt64 = 1 ItemBytes = 2 ItemInterface = 3 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cell ¶
func (*Cell) Increase64 ¶
type CompressOpt ¶
type CompressOpt struct {
Level int
}
func NewCompressOpt ¶
func NewCompressOpt(level int) *CompressOpt
type Grid ¶
type Grid struct {
// contains filtered or unexported fields
}
Memory Cache Grid
| Grid | | cell1, cell2, ..., cell1024 | | item1, item2, ..., item1000000 |
func (*Grid) IncreaseInt64 ¶
func (*Grid) WriteInterface ¶
type Item ¶
type Item struct { Key []byte ExpireAt int64 Type ItemType ValueInt64 int64 ValueBytes []byte ValueInterface interface{} IsCompressed bool // linked list Prev *Item Next *Item // contains filtered or unexported fields }
func (*Item) IncreaseInt64 ¶
type LimitCountOpt ¶
type LimitCountOpt struct {
Count int
}
func NewLimitCountOpt ¶
func NewLimitCountOpt(count int) *LimitCountOpt
type LimitSizeOpt ¶
type LimitSizeOpt struct {
Size int64
}
func NewLimitSizeOpt ¶
func NewLimitSizeOpt(size int64) *LimitSizeOpt
type RecycleIntervalOpt ¶
type RecycleIntervalOpt struct {
Interval int
}
func NewRecycleIntervalOpt ¶
func NewRecycleIntervalOpt(interval int) *RecycleIntervalOpt
Click to show internal directories.
Click to hide internal directories.