StoreApi
‘StoreApi’ is a class representing Endpoint’s API for Stores and their files.
Static Methods
create(connection:)
Creates an instance of ‘StoreApi’Gets a list of Stores in given Context.
Params
connection
inout Connection
instance of ’ConnectionID of the Context to get the Stores from
Returns
StoreApi ·
StoreApi struct with list query parameters
Methods
listStores(contextId:pagingQuery:)
struct containing list of Stores
Params
contextId
std.string
Gets a list of Stores in given Context.
pagingQuery
privmx.endpoint.core.PagingQuery
ID of the Context to get the Stores from
Returns
privmx.StoreList ·
struct with list query parameters
listStores(contextId:query:)
Params
contextId
std.string
query
privmx.endpoint.core.PagingQuery
Returns
privmx.StoreList ·
getStore(storeId:)
Gets a single Store by given Store ID.
Params
storeId
std.string
ID of the Store to get
Returns
privmx.endpoint.store.Store ·
struct containing information about the Store
createStore(contextId:users:managers:publicMeta:privateMeta:policies:)
Creates a new Store in given Context.
Params
contextId
std.string
ID of the Context to create the Store in
users
privmx.UserWithPubKeyVector
vector of UserWithPubKey structs which indicates who will have access to the created Store
managers
privmx.UserWithPubKeyVector
vector of UserWithPubKey structs which indicates who will have access (and management rights) to the created store
publicMeta
privmx.endpoint.core.Buffer
public (unencrypted) metadata
privateMeta
privmx.endpoint.core.Buffer
private (encrypted) metadata
policies
privmx.endpoint.core.ContainerPolicy?
Store’s policies
Returns
std.string ·
created Store ID
updateStore(storeId:version:users:managers:publicMeta:privateMeta:force:forceGenerateNewKey:policies:)
Updates an existing Store.
Params
storeId
std.string
ID of the Store to update
version
Int64
vector of UserWithPubKey structs which indicates who will have access to the created Store
users
privmx.UserWithPubKeyVector
vector of UserWithPubKey structs which indicates who will have access (and management rights) to the
managers
privmx.UserWithPubKeyVector
public (unencrypted) metadata
publicMeta
privmx.endpoint.core.Buffer
private (encrypted) metadata
privateMeta
privmx.endpoint.core.Buffer
current version of the updated Store
force
Bool
force update (without checking version)
forceGenerateNewKey
Bool
force to regenerate a key for the Store
policies
privmx.endpoint.core.ContainerPolicy?
Store’s policies
deleteStore(storeId:)
Deletes a Store by given Store ID.
Params
storeId
std.string
ID of the Store to delete
getFile(fileId:)
Gets a single file by the given file ID.
Params
fileId
std.string
ID of the file to get
Returns
privmx.endpoint.store.File ·
struct containing information about the file
listFiles(storeId:pagingQuery:)
Gets a list of files in given Store.
Params
storeId
std.string
ID of the Store to get files from
pagingQuery
privmx.endpoint.core.PagingQuery
struct with list query parameters
Returns
privmx.FileList ·
struct containing list of files
listFiles(storeId:query:)
Params
storeId
std.string
query
privmx.endpoint.core.PagingQuery
Returns
privmx.FileList ·
createFile(storeId:publicMeta:privateMeta:size:randomWriteSupport:)
Creates a new file in a Store.
Params
storeId
std.string
ID of the Store to create the file in
publicMeta
privmx.endpoint.core.Buffer
public file metadata
privateMeta
privmx.endpoint.core.Buffer
private file metadata
size
Int64
size of the file
randomWriteSupport
Bool
enable random write support for file
Returns
privmx.StoreFileHandle ·
handle to write data
seekInFile(handle:position:)
Moves read cursor.
Params
handle
privmx.StoreFileHandle
handle to write file data
position
Int64
new cursor position
updateFile(fileId:publicMeta:privateMeta:size:)
Update an existing file in a Store.
Params
fileId
std.string
ID of the file to update
publicMeta
privmx.endpoint.core.Buffer
public file metadata
privateMeta
privmx.endpoint.core.Buffer
private file metadata
size
Int64
size of the file
Returns
privmx.StoreFileHandle ·
handle to write file data
updateFileMeta(fileId:publicMeta:privateMeta:)
Update metadata of an existing file in a Store.
Params
fileId
std.string
ID of the file to update
publicMeta
privmx.endpoint.core.Buffer
public file metadata
privateMeta
privmx.endpoint.core.Buffer
private file metadata
closeFile(handle:)
Closes the file handle.
Params
handle
privmx.StoreFileHandle
handle to read/write file data
Returns
std.string ·
ID of closed file
openFile(fileId:)
Opens a file to read.
Params
fileId
std.string
ID of the file to read
Returns
privmx.StoreFileHandle ·
handle to read file data
readFromFile(handle: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.
Params
handle
privmx.StoreFileHandle
handle to write file data
length
Int64
size of data to read
Returns
privmx.endpoint.core.Buffer ·
buffer with file data chunk
writeToFile(handle:dataChunk:truncate:)
Writes a file data.
Params
handle
privmx.StoreFileHandle
handle to write file data
dataChunk
privmx.endpoint.core.Buffer
file data chunk
truncate
Bool
truncate the file from: current pos + dataChunk size
deleteFile(fileId:)
Deletes a file by given ID.
Params
fileId
std.string
ID of the file to delete
syncFile(handle:)
Synchronize file handle data with newest data on serwer.
- Parameter handle: Store File handle to sync
- Throws: if the operation fails.
Params
handle
privmx.StoreFileHandle
subscribeFor(subscriptionQueries:)
Subscribe for the Store events on the given subscription query.
Params
subscriptionQueries
privmx.SubscriptionQueryVector
list of queries
Returns
privmx.SubscriptionIdVector ·
list of subscriptionIds in maching order to subscriptionQueries
unsubscribeFrom(subscriptionIds:)
Unsubscribe from events for the given subscriptionId.
Params
subscriptionIds
privmx.SubscriptionIdVector
list of subscriptionId
buildSubscriptionQuery(eventType:selectorType:selectorId:)
Generate subscription Query for the Store events.
Params
eventType
privmx.endpoint.store.EventType
type of event which you listen for
selectorType
privmx.endpoint.store.EventSelectorType
scope on which you listen for events
selectorId
std.string
ID of the selector
Returns
privmx.SubscriptionQuery ·
a properly formatted event subscription request.
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.