3 #include <zk/config.hpp>
9 #include "forwards.hpp"
34 explicit client(string_view conn_string);
37 explicit client(std::shared_ptr<connection> conn) noexcept;
45 static future<client>
connect(string_view conn_string);
65 future<get_result>
get(string_view path)
const;
73 future<watch_result>
watch(string_view path)
const;
81 future<get_children_result>
get_children(string_view path)
const;
86 future<watch_children_result>
watch_children(string_view path)
const;
89 future<exists_result>
exists(string_view path)
const;
94 future<watch_exists_result>
watch_exists(string_view path)
const;
119 future<create_result>
create(string_view path,
124 future<create_result>
create(string_view path,
144 future<get_acl_result>
get_acl(string_view path)
const;
216 std::shared_ptr<connection> _conn;
Describes the various result types of client operations.
Imports of optional and nullopt_t types, as well as the nullopt constexpr.
future< multi_result > commit(multi_op txn)
Commit the transaction specified by txn.
future< void > erase(string_view path, version check=version::any())
Erase the entry at the given path.
client(const connection_params ¶ms)
Create a client connected to the cluster specified by params.
Represents a version of the ACL of an entry.
future< watch_result > watch(string_view path) const
Similar to get, but if the call is successful (no error is returned), a watch will be left on the ent...
future< exists_result > exists(string_view path) const
Return the stat of the entry of the given path or nullopt if it does not exist.
future< create_result > create(string_view path, const buffer &data, const acl &rules, create_mode mode=create_mode::normal)
create_mode
When used in client::set, this value determines how the entry is created on the server.
Standard behavior of an entry – the opposite of doing any of the options.
static future< client > connect(string_view conn_string)
void close()
Close the underlying connection.
Used to specify parameters for a connection.
future< void > load_fence() const
Ensure that all subsequent reads observe the data at the transaction on the server at or past real-ti...
A collection of operations that will be performed atomically.
Controls the import of future and promise types.
Imports the string_view type as std::string_view.
future< get_acl_result > get_acl(string_view path) const
Return the ACL and stat of the entry of the given path.
future< watch_children_result > watch_children(string_view path) const
Similar to get_children, but if the call is successful (no error is returned), a watch will be left o...
An access control list is a wrapper around acl_rule instances.
Controls the buffer type.
future< watch_exists_result > watch_exists(string_view path) const
Similar to watch, but if the call is successful (no error is returned), a watch will be left on the e...
future< void > set_acl(string_view path, const acl &rules, acl_version check=acl_version::any())
Set the ACL for the entry of the given path if such an entry exists and the given version check match...
future< set_result > set(string_view path, const buffer &data, version check=version::any())
Set the data for the entry of the given path if such an entry exists and the given version matches th...
static constexpr version any()
When specified in an operation, this version specifier will always pass.
future< get_children_result > get_children(string_view path) const
Return the list of the children of the entry of the given path.
Represents a version of the data.
ZKPP_BUFFER_TYPE buffer
The buffer type.
A ZooKeeper client connection.