1
0
Fork 0
mirror of https://github.com/docker/awesome-compose.git synced 2025-04-26 10:43:35 +02:00

add go mysql redis sample

Signed-off-by: vishal979 <shantapowertech2@gmail.com>
This commit is contained in:
vishal979 2020-07-04 19:38:53 +05:30
parent 638c159abd
commit 207f73ab81
384 changed files with 233601 additions and 0 deletions

View file

@ -0,0 +1,35 @@
// +build go1.7
package redis
import (
"context"
"gopkg.in/redis.v5/internal/pool"
)
type baseClient struct {
connPool pool.Pooler
opt *Options
process func(Cmder) error
onClose func() error // hook called when client is closed
ctx context.Context
}
func (c *Client) Context() context.Context {
if c.ctx != nil {
return c.ctx
}
return context.Background()
}
func (c *Client) WithContext(ctx context.Context) *Client {
if ctx == nil {
panic("nil context")
}
c2 := c.copy()
c2.ctx = ctx
return c2
}