Set manually sets the value for a given key in the cache. It overwrites any existing value and error.
(key string, value string, err error)
| 62 | // Set manually sets the value for a given key in the cache. |
| 63 | // It overwrites any existing value and error. |
| 64 | func (c *PolicyCache) Set(key string, value string, err error) { |
| 65 | entry := &cacheEntry{ |
| 66 | value: value, |
| 67 | err: err, |
| 68 | } |
| 69 | c.Data.Store(key, entry) |
| 70 | } |
| 71 | |
| 72 | // NewPolicyCache creates and returns a new PolicyCache instance. |
| 73 | func NewPolicyCache(ctx context.Context) *PolicyCache { |
no outgoing calls