loopy

module
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 25, 2023 License: BSD-3-Clause

README

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
  • Set key
loopcli --server=127.0.0.1:9500 kv set "key/name" "key_value"
  • Get key
loopcli --server=127.0.0.1:9500 kv get "key/name"
  • Delete key
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/"

Directories

Path Synopsis
api module
cmd
internal
cli

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL