noexist(sdl)
case "getall":
getall(sdl)
+ case "listkeys":
+ listkeys(sdl)
case "removeall":
removeall(sdl)
case "emptymap":
fmt.Println(" found")
fmt.Println("getall Read all keys within a namespace. One can manually add keys under the used namespace and all")
fmt.Println(" those keys should be returned here. Performance is measured")
+ fmt.Println("listkeys List keys in the given namespace matching key search pattern.")
fmt.Println("removeall Remove all keys within a namespace. Performance is measured")
fmt.Println("emptymap Write an empty container. Performance is measured")
fmt.Println("multiple Make two writes. Performance is measured")
}
}
+func listkeys(sdl *sdlgo.SyncStorage) {
+ start := time.Now()
+ ns := "tag1"
+ pattern := "*"
+ keys, err := sdl.ListKeys(ns, pattern)
+ elapsed := time.Since(start)
+ if err == nil {
+ fmt.Printf("ListKeys(%s, %s): %s\n", ns, pattern, elapsed)
+ for _, i := range keys {
+ fmt.Println(i)
+ }
+ } else {
+ fmt.Println(err)
+ }
+}
+
func removeall(sdl *sdlgo.SyncStorage) {
start := time.Now()
err := sdl.RemoveAll("tag1")