StoreApi
'StoreApi' is a class representing Endpoint's API for Stores and their files.
Static Methods
create
Creates an instance of 'StoreApi'.
Params
connection
core::Connection &
instance of 'Connection'
Returns
StoreApi
·
StoreApi object
Methods
createStore
Creates a new Store in given Context.
Params
contextId
const std::string &
ID of the Context to create the Store in
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's 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's policies
deleteStore
Deletes a Store by given Store ID.
Params
storeId
const std::string &
ID of the Store to delete
getStore
Gets a single Store by given Store ID.
Params
storeId
const std::string &
ID of the Store to get
Returns
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
core::PagingList<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
randomWriteSupport
bool
enable random write support for 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
truncate
bool
truncate the file from: current pos + dataChunk size
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
·
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
core::PagingList<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
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
subscribeFor
Subscribe for the Store events on the given subscription query.
Params
subscriptionQueries
const std::vector<std::string> &
list of queries
Returns
std::vector<std::string>
·
list of subscriptionIds in maching order to subscriptionQueries
unsubscribeFrom
Unsubscribe from events for the given subscriptionId.
Params
subscriptionIds
const std::vector<std::string> &
list of subscriptionId
buildSubscriptionQuery
Generate subscription Query for the Store events.
Params
eventType
EventType
type of event which you listen for
selectorType
EventSelectorType
scope on which you listen for events
selectorId
const std::string &
ID of the selector
Returns
std::string
·
syncFile
Synchronize file handle data with newset data on serwer
Params
handle
const int64_t
handle to read/write file data
We use cookies on our website. We use them to ensure the proper functioning of the site and, if you agree, for purposes we set, such as analytics or marketing.