# Functions
NewCacheMap creates new data cache by DataCacheMapOption The data updating is async, the Get method will return old data while updating in progress Only one goroutine will try to load the data during one RetryInterval First Get method call will trigger data loading, all Get requests will wait for first data until WaitTimeout The data will be loaded again if exceed Expiration since last load, and will be removed from cache if exceed EvictTimeout since last access.
NewDataCache create new DataCache with a CacheInitOption The data updating is synchronized, the Get method will return old data while updating in progress Only one go routine will try to load the data during one RetryInterval If didn't provide init data, first Get method call will trigger data loading, and all Get requests will wait for first data until WaitTimeout.
# Constants
DefaultRetryInterval default retry interval.
MilliToNanoSecond millisecond to nanosecond ratio.
# Structs
CacheInitOption initiation params of DataCache.
CacheItem is basic unit of cache.
CacheMap is a collection for CacheItems.
CacheMapOption has all options of a CacheMap.
DataCache a thread/goroutine safe in memory cache storage.
# Type aliases
LoadDataBatchByKeysCallback is a call back to load batch data from source.
LoadDataByKeyCallback is a call back to load data from source.
LoadDataCallback a call back function used to load data from remote.