No description
Find a file
Federico Ceratto 62fc98faca Release v. 0.2.0
2020-05-02 20:22:16 +01:00
tests Remove test 2020-05-02 20:21:50 +01:00
etcd_client.nim Updates for Nim 1.2.0 2020-05-02 20:18:18 +01:00
etcd_client.nimble Release v. 0.2.0 2020-05-02 20:22:16 +01:00
LICENSE Initial commit 2016-10-15 22:29:29 +01:00
README.adoc Create README.adoc 2016-10-21 14:30:36 +01:00

== etcd_client

Nim client for https://coreos.com/etcd/docs/latest/[etcd] - API v2

=== Installation

[source,bash]
----
nimble install etcd_client
----

=== Usage

Refer to the etcd documentation on how to use the datastore.

Run "nim doc2" to generate docs for the library.

Usage example:

[source,nim]
----
import etcd_client

let c = new_etcd_client(failover=false)

# get_version
let v = c.get_version()

# get_health
let v = c.get_health()

# get_debug_vars
let v = c.get_debug_vars()

# list directory
echo c.ls("/")

# create, get, update, delete key
c.create("test_key", "Hello world")
echo c.get("test_key")
c.update("test_key", "Hello 2")
c.del("test_key")

# Get stats
echo c.get_leader_stats()
echo c.get_self_stats()
echo c.get_store_stats()

# cluster members
echo c.get_cluster_members()

# mkdir, rmdir
c.mkdir("test_dir")
c.rmdir("test_dir")
----

More working examples are available under tests/functional.nim