Commit Graph

79 Commits

Author SHA1 Message Date
zhangxiaoyu.york 1f6a0726d9
doc:remove rm_if interface param: value in README.md (#279)
remove  rm_if interface param: value in README.md

rm_if define as below:

```
  /**
   * Removes a single key but only if it has a specific value. Fails if the key
   * does not exists or the its value differs from the expected one.
   * @param key is the key to be deleted
   *
   * @return Returns etcdv3::ERROR_KEY_NOT_FOUND if the key does not exist.
   */
  pplx::task<Response> rm_if(std::string const& key,
                             std::string const& old_value);

  /**
   * Removes an existing key only if it has a specific modification index value.
   * Fails if the key does not exists or the modification index of it differs
   * from the expected one.
   * @param key is the key to be deleted
   * @param old_index is the expected index of the existing value
   *
   * @return Returns etcdv3::ERROR_KEY_NOT_FOUND if the key does not exist.
   */
  pplx::task<Response> rm_if(std::string const& key, int64_t old_index);
```
2024-08-23 13:11:42 +08:00
Tao He 5ccaccec43
Enable ipv6 endpoints support (#262)
Resolves #250

Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
2023-12-20 17:56:18 +08:00
Tao He b82efea7a9
Enable -fno-exceptions support (#261)
Resolves #259

Signed-off-by: Tao He <sighingnow@gmail.com>
2023-12-20 09:18:10 +08:00
Tao He 153546f965
Refactor the implementation of etcd transactions. (#236)
Fixes #234.

Signed-off-by: Tao He <sighingnow@gmail.com>
2023-07-15 17:07:34 +08:00
Tao He 32fae70113
Fixes the implementation of Observe() (#231)
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-07-01 13:30:43 +08:00
Tao He 09f665fe3e Format readme.md
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-06-30 15:37:27 +08:00
Tao He fcc5807748 Fixes a typo in README (fixes #229).
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-06-30 15:34:54 +08:00
Tao He e771d2f6da
Drop the boost dependency on the sync runtime (#216)
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-04-28 20:38:13 +08:00
Tao He c72e072f77
Add an option `BUILD_ETCD_CORE_ONLY=ON/OFF` to select the runtime (#208)
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-03-19 11:31:57 +08:00
Tao He 16a9638e3e Fixes a markup error in README.md
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-03-15 10:12:59 +08:00
Tao He f0f9c4e8c2
Enhance the campaign test and document the behaviour when timeout is set (#205)
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-03-14 19:43:37 +08:00
Tao He 9d3f8cec3d
Fixes bugs in ls/rmdir/watch for processing range end. (#199)
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-03-07 21:47:10 +08:00
Tao He 3133fbec21
Fixes the Check() error when if next refresh is not triggered yet (#193)
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-02-15 17:14:48 +08:00
Tao He 81d446e55c Remove in-repo vcpkg configurations
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-02-08 12:52:24 +08:00
Tao He 10f3435c28
Enable keys() to list elements without fetching values from server (#184)
* Enable keys() to list elements without fetching values from server
* Add concurrency control and cancel to CI workflows

Signed-off-by: Tao He <sighingnow@gmail.com>
2023-01-10 15:00:34 +08:00
Tao He 30c880dd05 Document the `client.observe()` API.
Resolves #148.

Signed-off-by: Tao He <sighingnow@gmail.com>
2022-10-24 14:53:10 +08:00
Tao He c7f17cdf0d Fixes the descirption in the docs, and revisit the order of test cases.
Signed-off-by: Tao He <sighingnow@gmail.com>
2022-10-18 09:21:06 +08:00
Tao He 1e72df7ca3 Add test cases and documentation to show that binary data as key/value works well.
Signed-off-by: Tao He <sighingnow@gmail.com>
2022-10-18 00:52:01 +08:00
Tao He ab255467d0
Taking error code from grpc. (#172)
Signed-off-by: Tao He <sighingnow@gmail.com>
2022-10-09 10:25:50 +08:00
Tao He 1108d986a7
Add transaction tests and documentations (#164)
Signed-off-by: Tao He <sighingnow@gmail.com>
2022-09-27 11:31:06 +08:00
Tao He 92efa7c9de Refine the README for openssl, API references, and how to unlock.
Signed-off-by: Tao He <sighingnow@gmail.com>
2022-09-24 11:38:17 +08:00
wangbinzjut 69a1bf3b30
Update README.md (#155)
Co-authored-by: wangbin13 <wangbin13@corp.netease.com>
2022-08-18 15:39:33 +08:00
Tao He bd42e7129e Use `make -j$(nproc)` rather than plain `make -j`.
Addresses issues in #152.

Signed-off-by: Tao He <sighingnow@gmail.com>
2022-08-17 11:22:17 +08:00
Tao He 2ed6cacce9
Add more variants for etcd::Watcher's constructor. (#144)
* Add more variants for etcd::Watcher's constructor.
* Use ASAN for testing on CI.
* Revert "Use ASAN for testing on CI."

This reverts commit 6ccc2161da.
2022-07-19 20:42:44 +08:00
Tao He e5f1167c69 Implements the timeout feature to the etcd client.
Signed-off-by: Tao He <sighingnow@gmail.com>
2022-05-22 22:57:38 +08:00
Tao He 8da8946409 Refactor the implementation of sync-client and async-client.
Signed-off-by: Tao He <sighingnow@gmail.com>
2022-05-22 21:42:06 +08:00
Tao He bd4ec37ff4 Use int64_t for etcd revisions/indexes.
Signed-off-by: Tao He <sighingnow@gmail.com>
2022-04-21 18:52:34 +08:00
Tao He 680e8ad5c6 Replace Tabs in sources and README with spaces.
Signed-off-by: Tao He <sighingnow@gmail.com>
2022-04-08 20:49:56 +08:00
Tao He 56c7189f92 Revisit the watcher's reconnect functionality.
Address #73, #76, #117 and #118.

Signed-off-by: Tao He <sighingnow@gmail.com>
2022-04-08 19:55:31 +08:00
Tao He 9a2afd4e81 Revert "Update Watcher re-connection sample."
This reverts commit 23394ab9bb.
2022-04-08 19:55:31 +08:00
Tao He 767f0b1c65
Test against centos latest. (#121)
Signed-off-by: Tao He <sighingnow@gmail.com>
2022-03-30 09:22:18 +08:00
David Pastor 23394ab9bb Update Watcher re-connection sample. 2022-03-29 19:39:04 +08:00
Tao He 345380a83a
Allow specifying the auth token TTL when auth with password. (#109)
* Allow specifying the auth token TTL when auth with password.
* Fixes.

Resolves #107.

Signed-off-by: Tao He <sighingnow@gmail.com>
2021-12-22 14:30:45 +08:00
Tao He 0d672ffa1c
Accept an `grpc::ChannelArguments` argument in client's constructors. (#104)
* Accept an `grpc::ChannelArguments` argument in client's constructors.

   Resolves #103.

* Backwards compatibility with Ubuntu 18.04.

Signed-off-by: Tao He <sighingnow@gmail.com>
2021-11-09 00:31:59 +08:00
Tao He a949dec288
Add an optional `target_name_override` to support multiple-endpoints with SSL. (#89)
Resolves #87.

Signed-off-by: Tao He <sighingnow@gmail.com>
2021-09-24 02:41:46 +08:00
Tao He cda80854eb
Implements "v3election.proto" APIs. (#84)
Resolves #81.

Signed-off-by: Tao He <sighingnow@gmail.com>
2021-09-16 00:46:21 +08:00
Tao He 116b49b784
Lint source code, improve the quality and readability. (#82)
* Lint the source first, prepare for implementing #81.

Signed-off-by: Tao He <sighingnow@gmail.com>
2021-09-15 14:59:55 +08:00
Tao He 891dc7bedf Revisit docs about how could we "reconnect" when failure.
See also:

   https://github.com/etcd-cpp-apiv3/etcd-cpp-apiv3/issues/73#issuecomment-888150328


Signed-off-by: Tao He <sighingnow@gmail.com>
2021-07-28 17:57:33 +08:00
Yue 2338a83fd5
Add a brief doc and sample code describing how a watcher can re-connect to etcd server after disconnected. (#76) 2021-07-15 23:55:01 +08:00
Tao He 0dc89e4c1e Add openssl/libssl-dev to requirements.
Resolves #71.

Signed-off-by: Tao He <sighingnow@gmail.com>
2021-07-01 18:00:26 +08:00
Tao He b3a193c75e Fixes several typos in REAEMD.
Fixes #63.

Signed-off-by: Tao He <sighingnow@gmail.com>
2021-06-01 17:27:20 +08:00
Tao He 46f36dac6d Fixes a typo in example code in README.
Signed-off-by: Tao He <sighingnow@gmail.com>
2021-05-28 14:34:08 +08:00
Tao He 9e77fdb2ee
Fixes lock, and the underlying keepalive implmentation. (#60)
* Fixes lock, and the underlying keepalive implmentation.

The previous implementation is buggy when a lot of locks happen at the same time,
as the cpprestsdk's threadpool use a fixed number of thread for posix platform:

https://github.com/microsoft/cpprestsdk/blob/master/Release/src/pplx/threadpool.cpp#L198

Signed-off-by: Tao He <sighingnow@gmail.com>
2021-05-21 18:05:35 +08:00
Nils Carlson ad2da0ac7e
Change KeepAlive lease expiry to throw std::out_of_range (#55)
Update documentation to show different exceptions used by KeepAlive as well.
2021-04-08 10:18:26 +08:00
Tao He 62a846d798
Handling (or checking) possible failure in lease's KeepAlive. (#53)
* Handling (or checking) possible failure in lease's KeepAlive.
* Add documentation.
* Enhance documentations.

Signed-off-by: Tao He <sighingnow@gmail.com>
2021-04-02 17:15:27 +08:00
Ruoyun Huang c18092c576
Update README.md (#47)
Fix a minor mistake in installation instruction.
2021-02-17 23:17:34 +08:00
Tao He 7aa851420c Fixes README.md.
Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
2021-02-07 09:32:23 +08:00
Tao He 03baacf9ea
Support secure transport and certificate-based authentication. (#42)
Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
2021-02-07 01:35:37 +08:00
Ashish Billore dfcd8073e6
Update README.md to add the "git clone" part for build & install process (#38)
Added details needed to build the project (git clone) and install the project (make install).
2021-02-01 21:16:37 +08:00
Tao He bcf5313eab Continue work for #36, add instructions about how to install deependencies. 2021-01-31 15:24:23 +08:00