WithRedis injects the request's Redis client into the context.
(ctx stdctx.Context, rdb *redis.Client)
| 50 | |
| 51 | // WithRedis injects the request's Redis client into the context. |
| 52 | func WithRedis(ctx stdctx.Context, rdb *redis.Client) stdctx.Context { |
| 53 | return stdctx.WithValue(ctx, redisContextKey, rdb) |
| 54 | } |
| 55 | |
| 56 | // RedisFromContext returns the request's Redis client from the context, or nil if not set. |
| 57 | func RedisFromContext(ctx stdctx.Context) *redis.Client { |