RDB returns the request's Redis client from context, or the default if not set.
(ctx stdctx.Context)
| 71 | |
| 72 | // RDB returns the request's Redis client from context, or the default if not set. |
| 73 | func (r *RedisResolver) RDB(ctx stdctx.Context) *redis.Client { |
| 74 | if r == nil { |
| 75 | return nil |
| 76 | } |
| 77 | if rdb := RedisFromContext(ctx); rdb != nil { |
| 78 | return rdb |
| 79 | } |
| 80 | return r.Default |
| 81 | } |
| 82 | |
| 83 | // WithEntry injects the host registry entry into the context. |
| 84 | func WithEntry(ctx stdctx.Context, e *Entry) stdctx.Context { |
no test coverage detected