Loopy
Loopy is designed to store and manage keys and values that are used by various services and applications. It provides a reliable system for tracking changes and updating text templates in real time.
Install with go
go install github.com/arwos/loopy/...@latest
Server
Run server:
loppy --config=./config.yaml
Console client
Work with template
loopcli --server=127.0.0.1:9500 template \
test_data/template.tmpl:test_data/template.out \
test_data/template2.tmpl:test_data/template2.out
Template functions:
- key - returns the key value or an empty string
{{key "key/name"}}
- key_or_default - returns the key value or default value
{{key_or_default "key/name" "default value"}}
- tree - returns a list of keys and value by prefix
{{range $index, $data := tree "key/"}}
index: {{$index}} key: {{$data.Key}} val: {{$data.Value}}
{{end}}
Work with keys
loopcli --server=127.0.0.1:9500 kv set "key/name" "key_value"
loopcli --server=127.0.0.1:9500 kv get "key/name"
loopcli --server=127.0.0.1:9500 kv del "key/name"
- List key by prefix (with empty value)
loopcli --server=127.0.0.1:9500 kv list "key/"
- Search key by prefix (without empty value)
loopcli --server=127.0.0.1:9500 kv search "key/"