Documentation ¶
Index ¶
- Constants
- type BucketCache
- func (sc BucketCache) Add(k string, x interface{}, d time.Duration) error
- func (sc BucketCache) Decrement(k string, n int64) error
- func (sc BucketCache) DecrementFloat(k string, n float64) error
- func (sc BucketCache) DecrementFloat32(k string, n float32) (float32, error)
- func (sc BucketCache) DecrementFloat64(k string, n float64) (float64, error)
- func (sc BucketCache) DecrementInt(k string, n int) (int, error)
- func (sc BucketCache) DecrementInt16(k string, n int16) (int16, error)
- func (sc BucketCache) DecrementInt32(k string, n int32) (int32, error)
- func (sc BucketCache) DecrementInt64(k string, n int64) (int64, error)
- func (sc BucketCache) DecrementInt8(k string, n int8) (int8, error)
- func (sc BucketCache) DecrementUint(k string, n uint) (uint, error)
- func (sc BucketCache) DecrementUint16(k string, n uint16) (uint16, error)
- func (sc BucketCache) DecrementUint32(k string, n uint32) (uint32, error)
- func (sc BucketCache) DecrementUint64(k string, n uint64) (uint64, error)
- func (sc BucketCache) DecrementUint8(k string, n uint8) (uint8, error)
- func (sc BucketCache) DecrementUintptr(k string, n uintptr) (uintptr, error)
- func (sc BucketCache) Delete(k string)
- func (sc BucketCache) DeleteExpired()
- func (sc BucketCache) Flush()
- func (sc BucketCache) Get(k string) (interface{}, bool)
- func (sc BucketCache) GetWithExpiration(k string) (interface{}, time.Time, bool)
- func (sc BucketCache) Increment(k string, n int64) error
- func (sc BucketCache) IncrementFloat(k string, n float64) error
- func (sc BucketCache) IncrementFloat32(k string, n float32) (float32, error)
- func (sc BucketCache) IncrementFloat64(k string, n float64) (float64, error)
- func (sc BucketCache) IncrementInt(k string, n int) (int, error)
- func (sc BucketCache) IncrementInt16(k string, n int16) (int16, error)
- func (sc BucketCache) IncrementInt32(k string, n int32) (int32, error)
- func (sc BucketCache) IncrementInt64(k string, n int64) (int64, error)
- func (sc BucketCache) IncrementInt8(k string, n int8) (int8, error)
- func (sc BucketCache) IncrementUint(k string, n uint) (uint, error)
- func (sc BucketCache) IncrementUint16(k string, n uint16) (uint16, error)
- func (sc BucketCache) IncrementUint32(k string, n uint32) (uint32, error)
- func (sc BucketCache) IncrementUint64(k string, n uint64) (uint64, error)
- func (sc BucketCache) IncrementUint8(k string, n uint8) (uint8, error)
- func (sc BucketCache) IncrementUintptr(k string, n uintptr) (uintptr, error)
- func (sc BucketCache) Items() []map[string]Item
- func (sc BucketCache) ItemsCount() []int
- func (sc BucketCache) Load(r io.Reader) error
- func (sc BucketCache) LoadFile(fname string) error
- func (sc BucketCache) OnEvicted(f func(string, interface{}))
- func (sc BucketCache) Replace(k string, x interface{}, d time.Duration) error
- func (sc BucketCache) SaveFile(fname string) error
- func (sc BucketCache) Set(k string, x interface{}, d time.Duration)
- func (sc BucketCache) SetDefault(k string, x interface{})
- func (sc BucketCache) SetRecover(k string, x interface{}, e int64)
- type Item
Constants ¶
View Source
const ( // For use with functions that take an expiration time. NoExpiration time.Duration = -1 // For use with functions that take an expiration time. Equivalent to // passing in the same expiration duration as was given to New() or // NewFrom() when the cache was created (e.g. 5 minutes.) DefaultExpiration time.Duration = 0 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BucketCache ¶
type BucketCache struct {
// contains filtered or unexported fields
}
func NewBucketCache ¶
func NewBucketCache(defaultExpiration, cleanupInterval time.Duration, shardnum int) *BucketCache
func (BucketCache) DecrementFloat ¶
func (BucketCache) DecrementFloat32 ¶
func (BucketCache) DecrementFloat64 ¶
func (BucketCache) DecrementInt16 ¶
func (BucketCache) DecrementInt32 ¶
func (BucketCache) DecrementInt64 ¶
func (BucketCache) DecrementInt8 ¶
func (BucketCache) DecrementUint ¶
func (BucketCache) DecrementUint16 ¶
func (BucketCache) DecrementUint32 ¶
func (BucketCache) DecrementUint64 ¶
func (BucketCache) DecrementUint8 ¶
func (BucketCache) DecrementUintptr ¶
func (BucketCache) DeleteExpired ¶
func (sc BucketCache) DeleteExpired()
func (BucketCache) GetWithExpiration ¶
func (BucketCache) IncrementFloat ¶
func (BucketCache) IncrementFloat32 ¶
func (BucketCache) IncrementFloat64 ¶
func (BucketCache) IncrementInt16 ¶
func (BucketCache) IncrementInt32 ¶
func (BucketCache) IncrementInt64 ¶
func (BucketCache) IncrementInt8 ¶
func (BucketCache) IncrementUint ¶
func (BucketCache) IncrementUint16 ¶
func (BucketCache) IncrementUint32 ¶
func (BucketCache) IncrementUint64 ¶
func (BucketCache) IncrementUint8 ¶
func (BucketCache) IncrementUintptr ¶
func (BucketCache) Items ¶
Returns the items in the cache. This may include items that have expired, but have not yet been cleaned up. If this is significant, the Expiration fields of the items should be checked. Note that explicit synchronization is needed to use a cache and its corresponding Items() return values at the same time, as the maps are shared.
func (BucketCache) ItemsCount ¶
func (sc BucketCache) ItemsCount() []int
func (BucketCache) SetDefault ¶
func (sc BucketCache) SetDefault(k string, x interface{})
func (BucketCache) SetRecover ¶
Click to show internal directories.
Click to hide internal directories.