KvdbApi
‘KvdbApi’ is a class representing Endpoint’s API for Kvdbs and their messages.
Methods
createKvdb(in:for:managedBy:withPublicMeta:withPrivateMeta:withPolicies:)
Creates a new KVDB in given Context.
Params
contextId
String
ID of the Context to create the KVDB in
users
[privmx.endpoint.core.UserWithPubKey]
array of UserWithPubKey structs which indicates who will have access to the created KVDB
managers
[privmx.endpoint.core.UserWithPubKey]
array of UserWithPubKey structs which indicates who will have access (and management rights) to the created KVDB
publicMeta
Data
public (unencrypted) metadata
privateMeta
Data
private (encrypted) metadata
policies
privmx.endpoint.core.ContainerPolicy?
KVDB’s policies
Returns
String
·
Id of the created KVDB
updateKvdb(_:atVersion:replacingUsers:replacingManagers:replacingPublicMeta:replacingPrivateMeta:force:forceGenerateNewKey:replacingPolicies:)
Updates an existing KVDB.
Params
kvdbId
String
ID of the KVDB to update
version
Int64
current version of the updated KVDB
users
[privmx.endpoint.core.UserWithPubKey]
array of UserWithPubKey structs which indicates who will have access to the created KVDB
managers
[privmx.endpoint.core.UserWithPubKey]
array of UserWithPubKey structs which indicates who will have access (and management rights) to the created KVDB
publicMeta
Data
public (unencrypted) metadata
privateMeta
Data
private (encrypted) metadata
force
Bool
force update (without checking version)
forceGenerateNewKey
Bool
force to regenerate a key for the KVDB
policies
privmx.endpoint.core.ContainerPolicy?
KVDB’s policies
deleteKvdb(_:)
Deletes a KVDB by given KVDB ID.
Params
kvdbId
String
ID of the KVDB to delete
getKvdb(_:)
Gets a KVDB by given KVDB ID.
Params
kvdbId
String
ID of KVDB to get
Returns
privmx.endpoint.kvdb.Kvdb
·
struct containing info about the KVDB
listKvdbs(from:basedOn:)
Gets a list of Kvdbs in given Context.
Params
contextId
String
ID of the Context to get the Kvdbs from
pagingQuery
privmx.endpoint.core.PagingQuery
with list query parameters
Returns
privmx.KvdbList
·
struct containing a list of Kvdbs
hasEntry(kvdbId:key:)
Check whether the KVDB entry exists.
Params
kvdbId
String
KVDB ID of the KVDB entry to check
key
String
key of the KVDB entry to check
Returns
Bool
·
‘true’ if the KVDB has an entry with given key, ‘false’ otherwise
getEntry(from:for:)
Gets a KVDB entry by given KVDB entry key and KVDB ID.
Params
kvdbId
String
KVDB ID of the KVDB entry to get
key
String
key of the KVDB entry to get
Returns
privmx.endpoint.kvdb.KvdbEntry
·
struct containing the KVDB entry
listEntriesKeys(from:basedOn:)
Gets a list of KVDB entries keys from a KVDB.
Params
kvdbId
String
ID of the KVDB to list KVDB entries from
pagingQuery
privmx.endpoint.core.PagingQuery
with list query parameters
Returns
privmx.StringList
·
struct containing a list of KVDB entries
listEntries(from:basedOn:)
Gets a list of KVDB entries from a KVDB.
Params
kvdbId
String
ID of the KVDB to list KVDB entries from
pagingQuery
privmx.endpoint.core.PagingQuery
with list query parameters
Returns
privmx.KvdbEntryList
·
struct containing a list of KVDB entries
setEntry(in:for:atVersion:withPublicMeta:withPrivateMeta:containing:)
Sets a KVDB entry in the given KVDB.
Params
kvdbId
String
ID of the KVDB to set the entry to
key
String
KVDB entry key
version
Int64
the version of the Entry to set, the default value is 0 for creating a new KVDB Entry
publicMeta
Data
public KVDB entry metadata
privateMeta
Data
private KVDB entry metadata
data
Data
content of the KVDB entry
deleteEntry(from:for:)
Deletes a KVDB entry by given KVDB entry ID.
Params
kvdbId
String
KVDB ID of the KVDB entry to delete
key
String
key of the KVDB entry to delete
deleteEntries(from:for:)
Deletes KVDB entries by given KVDB IDs and the list of entry keys.
Params
kvdbId
String
ID of the KVDB database to delete from
keys
[String]
vector of the keys of the KVDB entries to delete
Returns
[String : Bool]
·
map with the statuses of deletion for every key
subscribeForEntryEvents(in:)
Subscribes for events in given KVDB.
Params
kvdbId
String
ID of the KVDB to subscribe
unsubscribeFromEntryEvents(in:)
Unsubscribes from events in given KVDB.
Params
kvdbId
String
ID of the KVDB to unsubscribe
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.