StoreApi
StoreApi is a class representing Endpoint's API for Stores and their files.
Static Methods
create
Returns
[StoreApi](/reference/cpp/endpoint/store/store-api)
·
StoreApi object
Methods
createStore
Creates a new Store in given Context.
Params
users
const std::vector<core::UserWithPubKey> &
vector of UserWithPubKey structs which indicates who will have access to the created Store
managers
const std::vector<core::UserWithPubKey> &
vector of UserWithPubKey structs which indicates who will have access (and management rights) to the created Store
publicMeta
const core::Buffer &
public (unencrypted) metadata
privateMeta
const core::Buffer &
private (encrypted) metadata
policies
const std::optional<core::ContainerPolicy> &
Store policies
Returns
std::string
·
created Store ID
updateStore
Updates an existing Store
Params
storeId
const std::string &
ID of the Store to update
users
const std::vector<core::UserWithPubKey> &
vector of UserWithPubKey structs which indicates who will have access to the created Store
managers
const std::vector<core::UserWithPubKey> &
vector of UserWithPubKey structs which indicates who will have access (and management rights) to the created Store
publicMeta
const core::Buffer &
public (unencrypted) metadata
privateMeta
const core::Buffer &
private (encrypted) metadata
version
const int64_t
current version of the updated Store
force
const bool
force update (without checking version)
forceGenerateNewKey
const bool
force to regenerate a key for the Store
policies
const std::optional<core::ContainerPolicy> &
Store policies
deleteStore
getStore
Returns
[Store](/reference/cpp/endpoint/store/types#store)
·
struct containing information about the Store
listStores
Gets a list of Stores in given Context.
Params
contextId
const std::string &
ID of the Context to get the Stores from
pagingQuery
const core::PagingQuery &
struct with list query parameters
Returns
[PagingList](/reference/cpp/endpoint/core/types#paginglist)<[Store](/reference/cpp/endpoint/store/types#store)>
·
struct containing list of Stores
createFile
Creates a new file in a Store
Params
storeId
const std::string &
ID of the Store to create the file in
publicMeta
const core::Buffer &
public file metadata
privateMeta
const core::Buffer &
private file metadata
size
const int64_t
size of the file
Returns
int64_t
·
handle to write data
updateFile
Update an existing file in a Store
Params
fileId
const std::string &
ID of the file to update
publicMeta
const core::Buffer &
public file metadata
privateMeta
const core::Buffer &
private file metadata
size
const int64_t
size of the file
Returns
int64_t
·
handle to write file data
updateFileMeta
Update metadata of an existing file in a Store
Params
fileId
const std::string &
ID of the file to update
publicMeta
const core::Buffer &
public file metadata
privateMeta
const core::Buffer &
private file metadata
writeToFile
Writes a file data.
Params
fileHandle
const int64_t
dataChunk
const core::Buffer &
file data chunk
deleteFile
Deletes a file by given ID.
Params
fileId
const std::string &
ID of the file to delete
getFile
Gets a single file by the given file ID.
Params
fileId
const std::string &
ID of the file to get
Returns
[File](/reference/cpp/endpoint/store/types#file)
·
struct containing information about the file
listFiles
Gets a list of files in given Store
Params
storeId
const std::string &
pagingQuery
const core::PagingQuery &
struct with list query parameters
Returns
[PagingList](/reference/cpp/endpoint/core/types#paginglist)<[File](/reference/cpp/endpoint/store/types#file)>
·
struct containing list of files
openFile
Opens a file to read.
Params
fileId
const std::string &
ID of the file to read
Returns
int64_t
·
handle to read file data
readFromFile
Reads file data. Single read call moves the files's cursor position by declared length or set it at the end of the file.
Params
fileHandle
const int64_t
length
const int64_t
size of data to read
Returns
[Buffer](/reference/cpp/endpoint/core/buffer)
·
buffer with file data chunk
seekInFile
Moves read cursor.
Params
fileHandle
const int64_t
position
const int64_t
new cursor position
closeFile
Closes the file handle.
Params
fileHandle
const int64_t
Returns
std::string
·
ID of closed file
subscribeForStoreEvents
Subscribes for the Store module main events.
unsubscribeFromStoreEvents
Unsubscribes from the Store module main events.