redis/export_test.go

38 lines
465 B
Go
Raw Normal View History

2013-11-07 18:20:15 +04:00
package redis
import (
"net"
2016-03-09 13:49:21 +03:00
"sync"
"time"
)
2013-11-07 18:20:15 +04:00
func (c *baseClient) Pool() pool {
return c.connPool
}
2015-03-23 11:23:33 +03:00
func (c *PubSub) Pool() pool {
return c.base.connPool
}
var NewConnDialer = newConnDialer
func (cn *conn) SetNetConn(netcn net.Conn) {
cn.netcn = netcn
}
2016-03-09 13:49:21 +03:00
var timeMu sync.Mutex
func SetTime(tm time.Time) {
2016-03-09 13:49:21 +03:00
timeMu.Lock()
now = func() time.Time {
return tm
}
2016-03-09 13:49:21 +03:00
timeMu.Unlock()
}
func RestoreTime() {
2016-03-09 13:49:21 +03:00
timeMu.Lock()
now = time.Now
2016-03-09 13:49:21 +03:00
timeMu.Unlock()
}