PolicyCacheFromContext retrieves the PolicyCache from the context. It returns the PolicyCache and true if found, or nil and false otherwise.
(ctx context.Context)
| 84 | // PolicyCacheFromContext retrieves the PolicyCache from the context. |
| 85 | // It returns the PolicyCache and true if found, or nil and false otherwise. |
| 86 | func PolicyCacheFromContext(ctx context.Context) (*PolicyCache, bool) { |
| 87 | cache, ok := ctx.Value(policyCacheKey).(*PolicyCache) |
| 88 | return cache, ok |
| 89 | } |
| 90 | |
| 91 | // WithPolicyCache returns a new context with the provided PolicyCache added. |
| 92 | func WithPolicyCache(ctx context.Context, cache *PolicyCache) context.Context { |
no outgoing calls