Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CachePool ¶
type CachePool struct {
Cache *cache.Cache
}
Callback function used to load data from data source if the cache is not existing Sets the cache pool and loading function
type CacheWorker ¶
type CacheWorker interface { // Get data of object which is missed in cache LoadSourceData() (interface{}, error) // Put loaded data of object into cache // 2nd parameter is the search SetCache(*cache.Cache, interface{}) }
Defines the behavior of access on cache pool 1. The getter of key in cache pool 2. The loading of source data if object is not in cache 3. The setting of data to cache
Click to show internal directories.
Click to hide internal directories.