#include <privmx/endpoint/kvdb/KvdbApi.hpp>


Public Member Functions | |
| KvdbApi () | |
| KvdbApi (const KvdbApi &obj) | |
| KvdbApi & | operator= (const KvdbApi &obj) |
| KvdbApi (KvdbApi &&obj) | |
| std::string | createKvdb (const std::string &contextId, const std::vector< core::UserWithPubKey > &users, const std::vector< core::UserWithPubKey > &managers, const core::Buffer &publicMeta, const core::Buffer &privateMeta, const std::optional< core::ContainerPolicy > &policies=std::nullopt) |
| void | updateKvdb (const std::string &kvdbId, const std::vector< core::UserWithPubKey > &users, const std::vector< core::UserWithPubKey > &managers, const core::Buffer &publicMeta, const core::Buffer &privateMeta, const int64_t version, const bool force, const bool forceGenerateNewKey, const std::optional< core::ContainerPolicy > &policies=std::nullopt) |
| void | deleteKvdb (const std::string &kvdbId) |
| Kvdb | getKvdb (const std::string &kvdbId) |
| core::PagingList< Kvdb > | listKvdbs (const std::string &contextId, const core::PagingQuery &pagingQuery) |
| KvdbEntry | getEntry (const std::string &kvdbId, const std::string &key) |
| bool | hasEntry (const std::string &kvdbId, const std::string &key) |
| core::PagingList< std::string > | listEntriesKeys (const std::string &kvdbId, const core::PagingQuery &pagingQuery) |
| core::PagingList< KvdbEntry > | listEntries (const std::string &kvdbId, const core::PagingQuery &pagingQuery) |
| void | setEntry (const std::string &kvdbId, const std::string &key, const core::Buffer &publicMeta, const core::Buffer &privateMeta, const core::Buffer &data, int64_t version=0) |
| void | deleteEntry (const std::string &kvdbId, const std::string &key) |
| std::map< std::string, bool > | deleteEntries (const std::string &kvdbId, const std::vector< std::string > &keys) |
| std::vector< std::string > | subscribeFor (const std::vector< std::string > &subscriptionQueries) |
| void | unsubscribeFrom (const std::vector< std::string > &subscriptionIds) |
| std::string | buildSubscriptionQuery (EventType eventType, EventSelectorType selectorType, const std::string &selectorId) |
| std::string | buildSubscriptionQueryForSelectedEntry (EventType eventType, const std::string &kvdbId, const std::string &kvdbEntryKey) |
| Public Member Functions inherited from privmx::endpoint::core::ExtendedPointer< KvdbApiImpl > | |
| ExtendedPointer & | operator= (const ExtendedPointer &obj) |
| std::shared_ptr< KvdbApiImpl > | getImpl () const |
Static Public Member Functions | |
| static KvdbApi | create (core::Connection &connection) |
Additional Inherited Members | |
| Protected Member Functions inherited from privmx::endpoint::core::ExtendedPointer< KvdbApiImpl > | |
| void | attachToPtrIfPossible () |
| void | detachFromPtrIfPossible () |
| Protected Attributes inherited from privmx::endpoint::core::ExtendedPointer< KvdbApiImpl > | |
| std::weak_ptr< KvdbApiImpl > | _ptr |
'KvdbApi' is a class representing Endpoint's API for Kvdbs and their messages.
| privmx::endpoint::kvdb::KvdbApi::KvdbApi | ( | ) |
//doc-gen:ignore
| std::string privmx::endpoint::kvdb::KvdbApi::buildSubscriptionQuery | ( | EventType | eventType, |
| EventSelectorType | selectorType, | ||
| const std::string & | selectorId ) |
Generate subscription Query for the KVDB events.
| eventType | type of event which you listen for |
| selectorType | scope on which you listen for events |
| selectorId | ID of the selector |
| std::string privmx::endpoint::kvdb::KvdbApi::buildSubscriptionQueryForSelectedEntry | ( | EventType | eventType, |
| const std::string & | kvdbId, | ||
| const std::string & | kvdbEntryKey ) |
|
static |
| std::string privmx::endpoint::kvdb::KvdbApi::createKvdb | ( | const std::string & | contextId, |
| const std::vector< core::UserWithPubKey > & | users, | ||
| const std::vector< core::UserWithPubKey > & | managers, | ||
| const core::Buffer & | publicMeta, | ||
| const core::Buffer & | privateMeta, | ||
| const std::optional< core::ContainerPolicy > & | policies = std::nullopt ) |
Creates a new KVDB in given Context.
| contextId | ID of the Context to create the KVDB in |
| users | array of UserWithPubKey structs which indicates who will have access to the created KVDB |
| managers | array of UserWithPubKey structs which indicates who will have access (and management rights) to the created KVDB |
| publicMeta | public (unencrypted) metadata |
| privateMeta | private (encrypted) metadata |
| policies | KVDB's policies |
| std::map< std::string, bool > privmx::endpoint::kvdb::KvdbApi::deleteEntries | ( | const std::string & | kvdbId, |
| const std::vector< std::string > & | keys ) |
Deletes KVDB entries by given KVDB IDs and the list of entry keys.
| kvdbId | ID of the KVDB database to delete from |
| keys | vector of the keys of the KVDB entries to delete |
| void privmx::endpoint::kvdb::KvdbApi::deleteEntry | ( | const std::string & | kvdbId, |
| const std::string & | key ) |
Deletes a KVDB entry by given KVDB entry ID.
| kvdbId | KVDB ID of the KVDB entry to delete |
| key | key of the KVDB entry to delete |
| void privmx::endpoint::kvdb::KvdbApi::deleteKvdb | ( | const std::string & | kvdbId | ) |
Deletes a KVDB by given KVDB ID.
| kvdbId | ID of the KVDB to delete |
| KvdbEntry privmx::endpoint::kvdb::KvdbApi::getEntry | ( | const std::string & | kvdbId, |
| const std::string & | key ) |
Gets a KVDB entry by given KVDB entry key and KVDB ID.
| kvdbId | KVDB ID of the KVDB entry to get |
| key | key of the KVDB entry to get |
| Kvdb privmx::endpoint::kvdb::KvdbApi::getKvdb | ( | const std::string & | kvdbId | ) |
Gets a KVDB by given KVDB ID.
| kvdbId | ID of KVDB to get |
| bool privmx::endpoint::kvdb::KvdbApi::hasEntry | ( | const std::string & | kvdbId, |
| const std::string & | key ) |
Check whether the KVDB entry exists.
| kvdbId | KVDB ID of the KVDB entry to check |
| key | key of the KVDB entry to check |
| core::PagingList< KvdbEntry > privmx::endpoint::kvdb::KvdbApi::listEntries | ( | const std::string & | kvdbId, |
| const core::PagingQuery & | pagingQuery ) |
Gets a list of KVDB entries from a KVDB.
| kvdbId | ID of the KVDB to list KVDB entries from |
| pagingQuery | with list query parameters |
| core::PagingList< std::string > privmx::endpoint::kvdb::KvdbApi::listEntriesKeys | ( | const std::string & | kvdbId, |
| const core::PagingQuery & | pagingQuery ) |
Gets a list of KVDB entries keys from a KVDB.
| kvdbId | ID of the KVDB to list KVDB entries from |
| pagingQuery | with list query parameters |
| core::PagingList< Kvdb > privmx::endpoint::kvdb::KvdbApi::listKvdbs | ( | const std::string & | contextId, |
| const core::PagingQuery & | pagingQuery ) |
Gets a list of Kvdbs in given Context.
| contextId | ID of the Context to get the Kvdbs from |
| pagingQuery | with list query parameters |
| void privmx::endpoint::kvdb::KvdbApi::setEntry | ( | const std::string & | kvdbId, |
| const std::string & | key, | ||
| const core::Buffer & | publicMeta, | ||
| const core::Buffer & | privateMeta, | ||
| const core::Buffer & | data, | ||
| int64_t | version = 0 ) |
Sets a KVDB entry in the given KVDB.
| kvdbId | ID of the KVDB to set the entry to |
| key | KVDB entry key |
| publicMeta | public KVDB entry metadata |
| privateMeta | private KVDB entry metadata |
| data | content of the KVDB entry |
| std::vector< std::string > privmx::endpoint::kvdb::KvdbApi::subscribeFor | ( | const std::vector< std::string > & | subscriptionQueries | ) |
Subscribe for the KVDB events on the given subscription query.
| subscriptionQueries | list of queries |
| void privmx::endpoint::kvdb::KvdbApi::unsubscribeFrom | ( | const std::vector< std::string > & | subscriptionIds | ) |
Unsubscribe from events for the given subscriptionId.
| subscriptionIds | list of subscriptionId |
| void privmx::endpoint::kvdb::KvdbApi::updateKvdb | ( | const std::string & | kvdbId, |
| const std::vector< core::UserWithPubKey > & | users, | ||
| const std::vector< core::UserWithPubKey > & | managers, | ||
| const core::Buffer & | publicMeta, | ||
| const core::Buffer & | privateMeta, | ||
| const int64_t | version, | ||
| const bool | force, | ||
| const bool | forceGenerateNewKey, | ||
| const std::optional< core::ContainerPolicy > & | policies = std::nullopt ) |
Updates an existing KVDB.
| kvdbId | ID of the KVDB to update |
| users | array of UserWithPubKey structs which indicates who will have access to the created KVDB |
| managers | array of UserWithPubKey structs which indicates who will have access (and management rights) to the created KVDB |
| publicMeta | public (unencrypted) metadata |
| privateMeta | private (encrypted) metadata |
| version | current version of the updated KVDB |
| force | force update (without checking version) |
| forceGenerateNewKey | force to regenerate a key for the KVDB |
| policies | KVDB's policies |