Skip to content
/ loopy Public

Service Discovery and KeyValue Storage

License

Notifications You must be signed in to change notification settings

arwos/loopy

Repository files navigation

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 go.arwos.org/loopy/...@latest

Server

Run server:

loppy --config=./config.yaml

Console client

Work with template

loopycli --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

  • 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/"