Initial commit
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package redis
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestF2(t *testing.T) {
|
||||
ts := time.Now().Local().Format("2006-02-01-15")
|
||||
t.Log(ts)
|
||||
}
|
||||
|
||||
func TestScan(t *testing.T) {
|
||||
mgr, err := NewManagerWithUrl("redis://127.0.0.1:6379/1", nil)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
set := NewHash(mgr.Client(), "set-test-key")
|
||||
for i := 0; i < 1000; i++ {
|
||||
set.Set(fmt.Sprintf("name:%d", i), fmt.Sprintf("value:%d", i))
|
||||
}
|
||||
|
||||
err = set.Scan("", 20, func(name, value string) {
|
||||
t.Logf("N: %s, V:%s\n", name, value)
|
||||
})
|
||||
t.Log(err)
|
||||
}
|
||||
Reference in New Issue
Block a user