(cacheName string, key string, value string, expiration *time.Duration)
| 77 | } |
| 78 | |
| 79 | func SetKey(cacheName string, key string, value string, expiration *time.Duration) error { |
| 80 | for i, name := range CacheNames { |
| 81 | if name == cacheName { |
| 82 | if expiration == nil { |
| 83 | expiration = &CacheConfig[i].TTL |
| 84 | } |
| 85 | |
| 86 | CacheConfig[i].Logger.Debugf("Setting key %s to %s with expiration %v", key, value, *expiration) |
| 87 | |
| 88 | if err := Caches[i].SetWithExpire(key, value, *expiration); err != nil { |
| 89 | CacheConfig[i].Logger.Warningf("While setting key %s in cache %s: %s", key, cacheName, err) |
| 90 | } |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | return nil |
| 95 | } |
| 96 | |
| 97 | func GetKey(cacheName string, key string) (string, error) { |
| 98 | for i, name := range CacheNames { |
no outgoing calls
searching dependent graphs…