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:
parent
638c159abd
commit
207f73ab81
384 changed files with 233601 additions and 0 deletions
35
go-mysql-redis/vendor/gopkg.in/redis.v5/redis_context.go
generated
vendored
Normal file
35
go-mysql-redis/vendor/gopkg.in/redis.v5/redis_context.go
generated
vendored
Normal 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue