This is a simple library for communicating with ETCD. The library is incomplete as I only implemented the functions I need (set, get, watch, delete). Feel free to contribute!
A: Because there is not much libraries that do that out there. There is one library by Nokia, which is not maintained anymore and is full of bugs and is not thread-safe. Clang-thread-sanitizer was screaming all the time while I was using it. Besides, the library is extremely complicated to compile and use, as grpc has to be embedded into that system, which itself depends on too many things.
This library is thread-safe. Any design changes I do, go to tests, and are executed with clang-thread-sanitizer. The library also uses the json gateway of etcd. While this has its limitations, it is very simple.
- boost-beast and algorithm (header-only, retrieved using conan)
- gtest, if you wanna compile with the tests (as a submodule)
- jsoncpp
Boost is added with conan, it should get conan for you automatically, because beast is quite new and is not available on all operating systems in the package that comes with the package manager. Please manage the cmake file as you find necessary.
- Clone with
git clone --recursive https://github.com/TheQuantumPhysicist/etcd-beast-client
Make sure you clone the submodules (that is why that recursive is there) - Edit the CMake file to where your boost library is (I recommend that you compile it yourself)
- create a build directory
- run
cmake -DCMAKE_INSTALL_PREFIX=/path/to/install /path/to/the/repo/that/you/cloned
from within the build directory - run
make
- run
make install
Please do not install the library to your system as root unless you know what you are doing. I have not tried that and I never do that in my system.
Feel free to contribute by pushing to branches. Please make sure any changes you make are thread-safe by heavily testing with clang-thread-sanitizer. This is the primary requirement of this library, besides testing anything added.