# Functions
Contains checks and returns true if `key` exists in the cache, or else returns false.
Data returns a copy of all key-value pairs in the cache as map type.
Get retrieves and returns the associated value of given `key`.
GetExpire retrieves and returns the expiration of `key` in the cache.
GetOrSet retrieves and returns the value of `key`, or sets `key`-`value` pair and returns `value` if `key` does not exist in the cache.
GetOrSetFunc retrieves and returns the value of `key`, or sets `key` with result of function `f` and returns its result if `key` does not exist in the cache.
GetOrSetFuncLock retrieves and returns the value of `key`, or sets `key` with result of function `f` and returns its result if `key` does not exist in the cache.
Keys returns all keys in the cache as slice.
KeyStrings returns all keys in the cache as string slice.
MustContains acts like Contains, but it panics if any error occurs.
MustData acts like Data, but it panics if any error occurs.
MustGet acts like Get, but it panics if any error occurs.
MustGetExpire acts like GetExpire, but it panics if any error occurs.
MustGetOrSet acts like GetOrSet, but it panics if any error occurs.
MustGetOrSetFunc acts like GetOrSetFunc, but it panics if any error occurs.
MustGetOrSetFuncLock acts like GetOrSetFuncLock, but it panics if any error occurs.
MustKeys acts like Keys, but it panics if any error occurs.
MustKeyStrings acts like KeyStrings, but it panics if any error occurs.
MustSize acts like Size, but it panics if any error occurs.
MustValues acts like Values, but it panics if any error occurs.
New creates and returns a new cache object using default memory adapter.
NewAdapterMemory creates and returns a new adapter_memory cache object.
NewAdapterMemoryLru creates and returns a new adapter_memory cache object with LRU.
NewAdapterRedis creates and returns a new memory cache object.
NewWithAdapter creates and returns a Cache object with given Adapter implements.
Remove deletes one or more keys from cache, and returns its value.
Removes deletes `keys` in the cache.
Set sets cache with `key`-`value` pair, which is expired after `duration`.
SetIfNotExist sets cache with `key`-`value` pair which is expired after `duration` if `key` does not exist in the cache.
SetIfNotExistFunc sets `key` with result of function `f` and returns true if `key` does not exist in the cache, or else it does nothing and returns false if `key` already exists.
SetIfNotExistFuncLock sets `key` with result of function `f` and returns true if `key` does not exist in the cache, or else it does nothing and returns false if `key` already exists.
SetMap batch sets cache with key-value pairs by `data` map, which is expired after `duration`.
Size returns the number of items in the cache.
Update updates the value of `key` without changing its expiration and returns the old value.
UpdateExpire updates the expiration of `key` and returns the old expiration duration value.
Values returns all values in the cache as slice.
# Constants
Expire duration that never expires.
# Structs
AdapterMemory is an adapter implements using memory.
AdapterRedis is the gcache adapter implements using Redis server.
Cache struct.
# Interfaces
Adapter is the core adapter for cache features implements.
# Type aliases
Func is the cache function that calculates and returns the value.