Initialize individual cache
()
| 46 | |
| 47 | // Initialize individual cache |
| 48 | func InitCache() { |
| 49 | |
| 50 | // Read Lambda env variable |
| 51 | var initCache = os.Getenv(InitializeCacheOnStartup) |
| 52 | var initCacheInBool = false |
| 53 | if initCache != "" { |
| 54 | cacheInBool, err := strconv.ParseBool(initCache) |
| 55 | if err != nil { |
| 56 | panic(plugins.PrintPrefix + "Error while converting CACHE_EXTENSION_INIT_STARTUP env variable " + |
| 57 | initCache) |
| 58 | } else { |
| 59 | initCacheInBool = cacheInBool |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | // Initialize map and load data from individual services if "CACHE_EXTENSION_INIT_STARTUP" = true |
| 64 | plugins.InitParameters(cacheConfig.Parameters, initCacheInBool) |
| 65 | plugins.InitDynamodb(cacheConfig.Dynamodb, initCacheInBool) |
| 66 | } |
| 67 | |
| 68 | // Route request to corresponding cache handlers |
| 69 | func RouteCache(cacheType string, name string) string { |
no outgoing calls
no test coverage detected