Documentation
¶
Index ¶
- Constants
- type Reference
- func (lf *Reference) Delete(key string)
- func (lf *Reference) Get(key string) (value interface{}, ttl int64)
- func (lf *Reference) GetLen() int64
- func (lf *Reference) GetUnixTime() int64
- func (lf *Reference) Recycle()
- func (lf *Reference) Set(key string, value interface{}, ttlSecond int64) error
- func (lf *Reference) SetMaxRecords(limit int64)
Constants ¶
View Source
const ( MaxRecords = 5000000 MinRecords = 10000 MaxTTLSecs = 7200 RecycleIntervalSecs = 5 RecycleOverLimitRatio = 0.5 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reference ¶
type Reference struct {
// contains filtered or unexported fields
}
func (*Reference) Get ¶
if not found or timeout => return nil,0 if found and not timeout =>return not_nil_pointer,left_secs
func (*Reference) GetUnixTime ¶ added in v0.0.11
get current unix time in reference
func (*Reference) Set ¶
if ttl < 0 just return and nothing changes ttl is set to MaxTTLSecs if ttl > MaxTTLSecs if record exist , "0" ttl changes nothing if record not exist, "0" ttl is equal to "30" seconds
func (*Reference) SetMaxRecords ¶
RecycleOverLimitRatio of records will be recycled if the number of total keys exceeds this limit
Click to show internal directories.
Click to hide internal directories.