本文整理汇总了Golang中redis.Client.Flushdb方法的典型用法代码示例。如果您正苦于以下问题:Golang Client.Flushdb方法的具体用法?Golang Client.Flushdb怎么用?Golang Client.Flushdb使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类redis.Client
的用法示例。
在下文中一共展示了Client.Flushdb方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: FlushClient
func FlushClient(t *testing.T, client redis.Client) {
// flush it
e := client.Flushdb()
if e != nil {
t.Fatalf("on Flushdb - %s", e)
}
}
示例2: doPing
func doPing(client redis.Client, cnt int) (delta int64) {
t0 := time.Nanoseconds()
for i := 0; i < cnt; i++ {
client.Ping()
}
delta = time.Nanoseconds() - t0
client.Flushdb()
return
}
示例3: doPing
func doPing(client redis.Client, cnt int) (delta time.Duration) {
t0 := time.Now()
for i := 0; i < cnt; i++ {
client.Ping()
}
delta = time.Now().Sub(t0)
client.Flushdb()
return
}
示例4: doIncr
func doIncr(client redis.Client, cnt int) (delta int64) {
key := "ctr"
t0 := time.Nanoseconds()
for i := 0; i < cnt; i++ {
client.Incr(key)
}
delta = time.Nanoseconds() - t0
client.Flushdb()
return
}
示例5: doGet
func doGet(client redis.Client, cnt int) (delta time.Duration) {
key := "ctr"
t0 := time.Now()
for i := 0; i < cnt; i++ {
client.Get(key)
}
delta = time.Now().Sub(t0)
client.Flushdb()
return
}
示例6: flushAndQuitOnCompletion
func flushAndQuitOnCompletion(t *testing.T, client redis.Client) {
// flush it
e := client.Flushdb()
if e != nil {
t.Errorf("on Flushdb - %s", e)
}
e = client.Quit()
if e != nil {
t.Errorf("on Quit - %s", e)
}
}
示例7: doSet
func doSet(client redis.Client, cnt int) (delta int64) {
key := "ctr"
value := strings.Bytes("foo")
t0 := time.Nanoseconds()
for i := 0; i < cnt; i++ {
client.Set(key, value)
}
delta = time.Nanoseconds() - t0
client.Flushdb()
return
}
示例8: doSadd
func doSadd(client redis.Client, cnt int) (delta time.Duration) {
key := "set"
value := []byte("one")
t0 := time.Now()
for i := 0; i < cnt; i++ {
client.Sadd(key, value)
}
delta = time.Now().Sub(t0)
client.Flushdb()
return
}
示例9: doSadd
func doSadd(client redis.Client, cnt int) (delta int64) {
key := "set"
value := []byte("one")
t0 := time.Nanoseconds()
for i := 0; i < cnt; i++ {
client.Sadd(key, value)
}
delta = time.Nanoseconds() - t0
client.Flushdb()
return
}