|
|
|
@ -9,7 +9,7 @@ import (
|
|
|
|
|
"github.com/boltdb/bolt" |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
const usage = "bdb <(w)rite|(r)ead> <db>" |
|
|
|
|
const usage = "bdb <(w)rite|(r)ead|(b)uckets> <db>" |
|
|
|
|
const queued = "queued" |
|
|
|
|
|
|
|
|
|
func main() { |
|
|
|
@ -20,7 +20,7 @@ func main() {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
switch os.Args[1] { |
|
|
|
|
case "write", "read", "w", "r": |
|
|
|
|
case "write", "read", "w", "r", "buckets", "bkts", "b": |
|
|
|
|
default: |
|
|
|
|
fmt.Fprintf(os.Stderr, "%s\n", usage) |
|
|
|
|
os.Exit(1) |
|
|
|
@ -79,5 +79,12 @@ func main() {
|
|
|
|
|
|
|
|
|
|
return nil |
|
|
|
|
}) |
|
|
|
|
case "buckets", "bkts", "b": |
|
|
|
|
db.View(func(tx *bolt.Tx) error { |
|
|
|
|
return tx.ForEach(func(name []byte, _ *bolt.Bucket) error { |
|
|
|
|
fmt.Printf("%s\n", name) |
|
|
|
|
return nil |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|