add thing

This commit is contained in:
bel
2023-04-12 15:23:44 -06:00
parent db39d7b02e
commit 01db198192
3 changed files with 15 additions and 20 deletions

View File

@@ -3,12 +3,13 @@ package main
import (
"bufio"
"fmt"
"gogs.inhome.blapointe.com/local/args"
"gogs.inhome.blapointe.com/local/storage"
"log"
"os"
"strings"
"time"
"gogs.inhome.blapointe.com/local/args"
"gogs.inhome.blapointe.com/local/storage"
)
func main() {
@@ -17,7 +18,7 @@ func main() {
as.Append(args.STRING, "db", "type of store", "dynomite")
as.Append(args.STRING, "user", "user of store", "")
as.Append(args.STRING, "pass", "pass of store", "")
as.Append(args.STRING, "do", "[get set]", "get")
as.Append(args.STRING, "do", "[get set del list]", "get")
as.Append(args.STRING, "k", "key", "key")
as.Append(args.STRING, "v", "value", "value")
as.Append(args.STRING, "ns", "namespace", "")
@@ -52,6 +53,9 @@ func main() {
case "set":
ns := strings.Split(as.Get("ns").GetString(), " ")
err = db.Set(as.Get("k").GetString(), []byte(as.Get("v").GetString()), ns...)
case "del":
ns := strings.Split(as.Get("ns").GetString(), " ")
err = db.Set(as.Get("k").GetString(), nil, ns...)
case "cli":
reader := bufio.NewReader(os.Stdin)
for {