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.
go install go.arwos.org/loopy/...@latest
Run server:
loppy --config=./config.yaml
loopycli --server=127.0.0.1:9500 template \
test_data/template.tmpl:test_data/template.out \
test_data/template2.tmpl:test_data/template2.out
- 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}}
- Set key
loopycli --server=127.0.0.1:9500 kv set "key/name" "key_value"
- Get key
loopycli --server=127.0.0.1:9500 kv get "key/name"
- Delete key
loopycli --server=127.0.0.1:9500 kv del "key/name"
- List key by prefix (with empty value)
loopycli --server=127.0.0.1:9500 kv list "key/"
- Search key by prefix (without empty value)
loopycli --server=127.0.0.1:9500 kv search "key/"