MCPcopy Create free account
hub / github.com/aws-samples/aws-lambda-extensions / InitCache

Function InitCache

cache-extension-demo/extension/entry.go:48–66  ·  view source on GitHub ↗

Initialize individual cache

()

Source from the content-addressed store, hash-verified

46
47// Initialize individual cache
48func 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
69func RouteCache(cacheType string, name string) string {

Callers 1

InitCacheExtensionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected