mirror of
https://codeberg.org/scip/anydb.git
synced 2025-12-16 12:00:59 +01:00
more doc, fix format str
This commit is contained in:
4
Makefile
4
Makefile
@@ -66,11 +66,11 @@ clean:
|
||||
rm -rf $(tool) releases coverage.out
|
||||
|
||||
test:
|
||||
go test -v ./...
|
||||
ANYDB_PASSWORD=test go test -v ./...
|
||||
|
||||
singletest:
|
||||
@echo "Call like this: ''make singletest TEST=TestPrepareColumns MOD=lib"
|
||||
go test -run $(TEST) github.com/tlinden/anydb/$(MOD)
|
||||
ANYDB_PASSWORD=test go test -run $(TEST) github.com/tlinden/anydb/$(MOD)
|
||||
|
||||
cover-report:
|
||||
go test ./... -cover -coverprofile=coverage.out
|
||||
|
||||
@@ -145,6 +145,10 @@ curl localhost:8787/anydb/v1/foo
|
||||
# list keys
|
||||
curl localhost:8787/anydb/v1/
|
||||
|
||||
# sometimes you need to know some details about the current database
|
||||
# add -d for more details
|
||||
anydb info
|
||||
|
||||
# it comes with a manpage builtin
|
||||
anydb man
|
||||
```
|
||||
|
||||
14
example.toml
Normal file
14
example.toml
Normal file
@@ -0,0 +1,14 @@
|
||||
# defaults
|
||||
dbfile = "~/.config/anydb/default.db"
|
||||
dbbucket = "data"
|
||||
noheaders = false
|
||||
nohumanize = false
|
||||
encrypt = false
|
||||
listen = "localhost:8787"
|
||||
|
||||
# different setups for different buckets
|
||||
[buckets.data]
|
||||
encrypt = true
|
||||
|
||||
[buckets.test]
|
||||
encrypt = false
|
||||
@@ -104,10 +104,11 @@ func Info(writer io.Writer, conf *cfg.Config, info *app.DbInfo) error {
|
||||
if conf.NoHumanize {
|
||||
fmt.Fprintf(
|
||||
writer,
|
||||
"%19s: %s\n%19s: %d\n%19s: %d\n",
|
||||
"%19s: %s\n%19s: %d\n%19s: %d\n%19s: %t\n",
|
||||
"Bucket", bucket.Name,
|
||||
"Size", bucket.Size,
|
||||
"Keys", bucket.Keys)
|
||||
"Keys", bucket.Keys,
|
||||
"Encrypted", conf.Encrypt)
|
||||
} else {
|
||||
fmt.Fprintf(
|
||||
writer,
|
||||
@@ -120,7 +121,7 @@ func Info(writer io.Writer, conf *cfg.Config, info *app.DbInfo) error {
|
||||
if conf.Debug {
|
||||
val := reflect.ValueOf(&bucket.Stats).Elem()
|
||||
for i := 0; i < val.NumField(); i++ {
|
||||
fmt.Fprintf(writer, "%19s: %d\n", val.Type().Field(i).Name, val.Field(i))
|
||||
fmt.Fprintf(writer, "%19s: %v\n", val.Type().Field(i).Name, val.Field(i))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user