cli and ls s3

This commit is contained in:
Bel LaPointe
2020-02-13 07:12:40 -07:00
parent d39c226d13
commit be25dee55d
3 changed files with 35 additions and 4 deletions

View File

@@ -7,6 +7,8 @@ function main() {
local pass="${AWS_PASS:-"YXlRDCKZPDMWF7qXZIa/t4aBi2WCpd8uu2LWSZwQ"}"
local min="${1:-"---"}"
local max="${2:-"}}}"}"
shift
shift
go run main.go \
-do list \
-db minio \
@@ -15,7 +17,8 @@ function main() {
-pass "$pass" \
-ns "$bucket" \
-min "$min" \
-max "$max"
-max "$max" \
"$@"
}
if [ "$0" == "$BASH_SOURCE" ]; then

View File

@@ -47,9 +47,11 @@ func main() {
d := strings.Join(c, "\n\t")
b = []byte(fmt.Sprintf("%s", d))
case "get":
b, err = db.Get(as.Get("k").GetString())
ns := strings.Split(as.Get("ns").GetString(), " ")
b, err = db.Get(as.Get("k").GetString(), ns...)
case "set":
err = db.Set(as.Get("k").GetString(), []byte(as.Get("v").GetString()))
ns := strings.Split(as.Get("ns").GetString(), " ")
err = db.Set(as.Get("k").GetString(), []byte(as.Get("v").GetString()), ns...)
case "cli":
reader := bufio.NewReader(os.Stdin)
for {
@@ -80,4 +82,5 @@ func main() {
}
stop := time.Now()
log.Printf("(%v) %v: %s", stop.Sub(start), err, b)
fmt.Printf("%s", b)
}