Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultExpire is default expiration date. DefaultExpire = int64(50 * time.Second) // DeleteExpiredInterval is the default interval at which the worker deltes all expired cache objects DeleteExpiredInterval = int64(10 * time.Second) // DefaultShardsCount is the number of elements of concurrent map. DefaultShardsCount uint64 = 256 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Gocache ¶
type Gocache interface { // Get returns object with the given name from the cache. Get(string) (interface{}, bool) // Set sets object in the cache. Set(string, interface{}) bool // SetWithExpire sets object in cache with an expiration date. SetWithExpire(string, interface{}, time.Duration) bool // Delete deletes cache object of given name. Delete(string) // Clear clears cache. Clear() // StartExpired starts worker that deletes an expired cache object. // Deletion processing is executed at intervals of given time. StartExpired(dur time.Duration) Gocache // StopExpired stop worker that deletes an expired cache object. StopExpired() Gocache }
Gocache is base gocache interface.
Click to show internal directories.
Click to hide internal directories.