github.com/choria-io/go-choria@v0.28.1-0.20240416190746-b3bf9c7d5a45/internal/fs/cheats/kv.md (about)

     1  # further documentation https://choria.io/docs/streams/key-value/
     2  
     3  # to create a replicated KV bucket
     4  choria kv add CONFIG --replicas 3
     5  
     6  # to store a value in the bucket
     7  choria kv put CONFIG username bob
     8  
     9  # to read just the value with no additional details
    10  choria kv get CONFIG username --raw
    11  
    12  # view an audit trail for a key if history is kept
    13  choria kv history CONFIG username
    14  
    15  # to see the bucket status
    16  choria kv status CONFIG
    17  
    18  # observe real time changes for an entire bucket
    19  choria kv watch CONFIG
    20  
    21  # observe real time changes for all keys below users
    22  choria kv watch CONFIG 'users.>''
    23  
    24  # create a bucket backup for CONFIG into backups/CONFIG
    25  choria kv backup CONFIG ./backups/CONFIG
    26  
    27  # restore a bucket from a backup
    28  choria kv restore ./backups/CONFIG
    29  
    30  # list known buckets
    31  nats kv ls