#include <privmx/endpoint/store/StoreApi.hpp>


Public Member Functions | |
| StoreApi () | |
| StoreApi (const StoreApi &obj) | |
| StoreApi & | operator= (const StoreApi &obj) |
| StoreApi (StoreApi &&obj) | |
| std::string | createStore (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 | updateStore (const std::string &storeId, 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 | deleteStore (const std::string &storeId) |
| Store | getStore (const std::string &storeId) |
| core::PagingList< Store > | listStores (const std::string &contextId, const core::PagingQuery &pagingQuery) |
| int64_t | createFile (const std::string &storeId, const core::Buffer &publicMeta, const core::Buffer &privateMeta, const int64_t size, bool randomWriteSupport=false) |
| int64_t | updateFile (const std::string &fileId, const core::Buffer &publicMeta, const core::Buffer &privateMeta, const int64_t size) |
| void | updateFileMeta (const std::string &fileId, const core::Buffer &publicMeta, const core::Buffer &privateMeta) |
| void | writeToFile (const int64_t fileHandle, const core::Buffer &dataChunk, bool truncate=false) |
| void | deleteFile (const std::string &fileId) |
| File | getFile (const std::string &fileId) |
| core::PagingList< File > | listFiles (const std::string &storeId, const core::PagingQuery &pagingQuery) |
| int64_t | openFile (const std::string &fileId) |
| core::Buffer | readFromFile (const int64_t fileHandle, const int64_t length) |
| void | seekInFile (const int64_t fileHandle, const int64_t position) |
| std::string | closeFile (const int64_t fileHandle) |
| 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) |
| void | syncFile (const int64_t fileHandle) |
| Public Member Functions inherited from privmx::endpoint::core::ExtendedPointer< StoreApiImpl > | |
| ExtendedPointer & | operator= (const ExtendedPointer &obj) |
| std::shared_ptr< StoreApiImpl > | getImpl () const |
Static Public Member Functions | |
| static StoreApi | create (core::Connection &connection) |
Additional Inherited Members | |
| Protected Member Functions inherited from privmx::endpoint::core::ExtendedPointer< StoreApiImpl > | |
| void | attachToPtrIfPossible () |
| void | detachFromPtrIfPossible () |
| Protected Attributes inherited from privmx::endpoint::core::ExtendedPointer< StoreApiImpl > | |
| std::weak_ptr< StoreApiImpl > | _ptr |
'StoreApi' is a class representing Endpoint's API for Stores and their files.
| privmx::endpoint::store::StoreApi::StoreApi | ( | ) |
//doc-gen:ignore
| std::string privmx::endpoint::store::StoreApi::buildSubscriptionQuery | ( | EventType | eventType, |
| EventSelectorType | selectorType, | ||
| const std::string & | selectorId ) |
Generate subscription Query for the Store 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::store::StoreApi::closeFile | ( | const int64_t | fileHandle | ) |
Closes the file handle.
| handle | handle to read/write file data |
|
static |
| int64_t privmx::endpoint::store::StoreApi::createFile | ( | const std::string & | storeId, |
| const core::Buffer & | publicMeta, | ||
| const core::Buffer & | privateMeta, | ||
| const int64_t | size, | ||
| bool | randomWriteSupport = false ) |
| std::string privmx::endpoint::store::StoreApi::createStore | ( | 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 Store in given Context.
| contextId | ID of the Context to create the Store in |
| users | vector of UserWithPubKey structs which indicates who will have access to the created Store |
| managers | vector of UserWithPubKey structs which indicates who will have access (and management rights) to the created Store |
| publicMeta | public (unencrypted) metadata |
| privateMeta | private (encrypted) metadata |
| policies | Store's policies |
| void privmx::endpoint::store::StoreApi::deleteFile | ( | const std::string & | fileId | ) |
Deletes a file by given ID.
| fileId | ID of the file to delete |
| void privmx::endpoint::store::StoreApi::deleteStore | ( | const std::string & | storeId | ) |
| File privmx::endpoint::store::StoreApi::getFile | ( | const std::string & | fileId | ) |
Gets a single file by the given file ID.
| fileId | ID of the file to get |
| Store privmx::endpoint::store::StoreApi::getStore | ( | const std::string & | storeId | ) |
| core::PagingList< File > privmx::endpoint::store::StoreApi::listFiles | ( | const std::string & | storeId, |
| const core::PagingQuery & | pagingQuery ) |
| core::PagingList< Store > privmx::endpoint::store::StoreApi::listStores | ( | const std::string & | contextId, |
| const core::PagingQuery & | pagingQuery ) |
Gets a list of Stores in given Context.
| contextId | ID of the Context to get the Stores from |
| pagingQuery | struct with list query parameters |
| int64_t privmx::endpoint::store::StoreApi::openFile | ( | const std::string & | fileId | ) |
Opens a file to read.
| fileId | ID of the file to read |
| core::Buffer privmx::endpoint::store::StoreApi::readFromFile | ( | const int64_t | fileHandle, |
| const int64_t | length ) |
Reads file data. Single read call moves the files's cursor position by declared length or set it at the end of the file.
| handle | handle to write file data |
| length | size of data to read |
| void privmx::endpoint::store::StoreApi::seekInFile | ( | const int64_t | fileHandle, |
| const int64_t | position ) |
Moves read cursor.
| handle | handle to write file data |
| position | new cursor position |
| std::vector< std::string > privmx::endpoint::store::StoreApi::subscribeFor | ( | const std::vector< std::string > & | subscriptionQueries | ) |
Subscribe for the Store events on the given subscription query.
| subscriptionQueries | list of queries |
| void privmx::endpoint::store::StoreApi::syncFile | ( | const int64_t | fileHandle | ) |
Synchronize file handle data with newest data on server
| fileHandle | handle to read/write file data |
| void privmx::endpoint::store::StoreApi::unsubscribeFrom | ( | const std::vector< std::string > & | subscriptionIds | ) |
Unsubscribe from events for the given subscriptionId.
| subscriptionIds | list of subscriptionId |
| int64_t privmx::endpoint::store::StoreApi::updateFile | ( | const std::string & | fileId, |
| const core::Buffer & | publicMeta, | ||
| const core::Buffer & | privateMeta, | ||
| const int64_t | size ) |
Update an existing file in a Store.
| fileId | ID of the file to update |
| publicMeta | public file metadata |
| privateMeta | private file metadata |
| size | size of the file |
| void privmx::endpoint::store::StoreApi::updateFileMeta | ( | const std::string & | fileId, |
| const core::Buffer & | publicMeta, | ||
| const core::Buffer & | privateMeta ) |
Update metadata of an existing file in a Store.
| fileId | ID of the file to update |
| publicMeta | public file metadata |
| privateMeta | private file metadata |
| void privmx::endpoint::store::StoreApi::updateStore | ( | const std::string & | storeId, |
| 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 Store.
| storeId | ID of the Store to update |
| users | vector of UserWithPubKey structs which indicates who will have access to the created Store |
| managers | vector of UserWithPubKey structs which indicates who will have access (and management rights) to the created Store |
| publicMeta | public (unencrypted) metadata |
| privateMeta | private (encrypted) metadata |
| version | current version of the updated Store |
| force | force update (without checking version) |
| forceGenerateNewKey | force to regenerate a key for the Store |
| policies | Store's policies |
| void privmx::endpoint::store::StoreApi::writeToFile | ( | const int64_t | fileHandle, |
| const core::Buffer & | dataChunk, | ||
| bool | truncate = false ) |
Writes a file data.
| handle | handle to write file data |
| dataChunk | file data chunk |
| truncate | truncate the file from: current pos + dataChunk size |