Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheOption ¶
type CacheOption map[string]interface{}
type CacheValue ¶
type KvCache ¶
type KvCache struct {
// contains filtered or unexported fields
}
func NewKvCache ¶
func NewKvCache(opts ...kvcachehelper.CacheOptions) *KvCache
NewKvCache instantiates a new Cache and sets the default values. The default expiration time is set to 6 hours from the current time. The expiration time can be overridden by passing an expirationTime option. Example: cache := NewKvCache(ExpirationTime: time.Now().Add(1 * time.Hour))
func (*KvCache) Get ¶
Get retrieves a value from the cache. If the key does not exist or the value has expired, it will return false.
Click to show internal directories.
Click to hide internal directories.