PrivMX Endpoint v2.7.0
Loading...
Searching...
No Matches
privmx::endpoint::kvdb::KvdbApi Class Reference

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

Inheritance diagram for privmx::endpoint::kvdb::KvdbApi:
Collaboration diagram for privmx::endpoint::kvdb::KvdbApi:

Public Member Functions

 KvdbApi ()
 KvdbApi (const KvdbApi &obj)
KvdbApioperator= (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< KvdblistKvdbs (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< KvdbEntrylistEntries (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

Detailed Description

'KvdbApi' is a class representing Endpoint's API for Kvdbs and their messages.

Constructor & Destructor Documentation

◆ KvdbApi()

privmx::endpoint::kvdb::KvdbApi::KvdbApi ( )

//doc-gen:ignore

Member Function Documentation

◆ buildSubscriptionQuery()

std::string privmx::endpoint::kvdb::KvdbApi::buildSubscriptionQuery ( EventType eventType,
EventSelectorType selectorType,
const std::string & selectorId )

Generate subscription Query for the KVDB events.

Parameters
eventTypetype of event which you listen for
selectorTypescope on which you listen for events
selectorIdID of the selector

◆ buildSubscriptionQueryForSelectedEntry()

std::string privmx::endpoint::kvdb::KvdbApi::buildSubscriptionQueryForSelectedEntry ( EventType eventType,
const std::string & kvdbId,
const std::string & kvdbEntryKey )

Generate subscription Query for the KVDB events for single KvdbEntry.

Parameters
eventTypetype of event which you listen for
kvdbIdId of Kvdb
kvdbEntryIdKey of Kvdb Entry

◆ create()

KvdbApi privmx::endpoint::kvdb::KvdbApi::create ( core::Connection & connection)
static

Creates an instance of 'KvdbApi'.

Parameters
connectioninstance of 'Connection'
Returns
KvdbApi object

◆ createKvdb()

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.

Parameters
contextIdID of the Context to create the KVDB in
usersarray of UserWithPubKey structs which indicates who will have access to the created KVDB
managersarray of UserWithPubKey structs which indicates who will have access (and management rights) to the created KVDB
publicMetapublic (unencrypted) metadata
privateMetaprivate (encrypted) metadata
policiesKVDB's policies
Returns
ID of the created KVDB

◆ deleteEntries()

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.

Parameters
kvdbIdID of the KVDB database to delete from
keysvector of the keys of the KVDB entries to delete
Returns
map with the statuses of deletion for every key

◆ deleteEntry()

void privmx::endpoint::kvdb::KvdbApi::deleteEntry ( const std::string & kvdbId,
const std::string & key )

Deletes a KVDB entry by given KVDB entry ID.

Parameters
kvdbIdKVDB ID of the KVDB entry to delete
keykey of the KVDB entry to delete

◆ deleteKvdb()

void privmx::endpoint::kvdb::KvdbApi::deleteKvdb ( const std::string & kvdbId)

Deletes a KVDB by given KVDB ID.

Parameters
kvdbIdID of the KVDB to delete

◆ getEntry()

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.

Parameters
kvdbIdKVDB ID of the KVDB entry to get
keykey of the KVDB entry to get
Returns
struct containing the KVDB entry

◆ getKvdb()

Kvdb privmx::endpoint::kvdb::KvdbApi::getKvdb ( const std::string & kvdbId)

Gets a KVDB by given KVDB ID.

Parameters
kvdbIdID of KVDB to get
Returns
struct containing info about the KVDB

◆ hasEntry()

bool privmx::endpoint::kvdb::KvdbApi::hasEntry ( const std::string & kvdbId,
const std::string & key )

Check whether the KVDB entry exists.

Parameters
kvdbIdKVDB ID of the KVDB entry to check
keykey of the KVDB entry to check
Returns
'true' if the KVDB has an entry with given key, 'false' otherwise

◆ listEntries()

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.

Parameters
kvdbIdID of the KVDB to list KVDB entries from
pagingQuerywith list query parameters
Returns
struct containing a list of KVDB entries

◆ listEntriesKeys()

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.

Parameters
kvdbIdID of the KVDB to list KVDB entries from
pagingQuerywith list query parameters
Returns
struct containing a list of KVDB entries

◆ listKvdbs()

core::PagingList< Kvdb > privmx::endpoint::kvdb::KvdbApi::listKvdbs ( const std::string & contextId,
const core::PagingQuery & pagingQuery )

Gets a list of Kvdbs in given Context.

Parameters
contextIdID of the Context to get the Kvdbs from
pagingQuerywith list query parameters
Returns
struct containing a list of Kvdbs

◆ setEntry()

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.

Parameters
kvdbIdID of the KVDB to set the entry to
keyKVDB entry key
publicMetapublic KVDB entry metadata
privateMetaprivate KVDB entry metadata
datacontent of the KVDB entry

◆ subscribeFor()

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.

Parameters
subscriptionQuerieslist of queries
Returns
list of subscriptionIds in maching order to subscriptionQueries

◆ unsubscribeFrom()

void privmx::endpoint::kvdb::KvdbApi::unsubscribeFrom ( const std::vector< std::string > & subscriptionIds)

Unsubscribe from events for the given subscriptionId.

Parameters
subscriptionIdslist of subscriptionId

◆ updateKvdb()

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.

Parameters
kvdbIdID of the KVDB to update
usersarray of UserWithPubKey structs which indicates who will have access to the created KVDB
managersarray of UserWithPubKey structs which indicates who will have access (and management rights) to the created KVDB
publicMetapublic (unencrypted) metadata
privateMetaprivate (encrypted) metadata
versioncurrent version of the updated KVDB
forceforce update (without checking version)
forceGenerateNewKeyforce to regenerate a key for the KVDB
policiesKVDB's policies

The documentation for this class was generated from the following file: