KvdbApi
‘KvdbApi’ is a class representing Endpoint’s API for Kvdbs and their messages.
Static Methods
create(connection:)
Creates an instance of ‘KvdbApi’.
Params
connection
inout Connection
instance of ‘Connection’
Returns
KvdbApi
·
KvdbApi
object.
Methods
createKvdb(contextId:users:managers:publicMeta:privateMeta:policies:)
Creates a new KVDB in given Context.
Params
contextId
std.string
ID of the Context to create the KVDB in
users
privmx.UserWithPubKeyVector
array of UserWithPubKey structs which indicates who will have access to the created KVDB
managers
privmx.UserWithPubKeyVector
array of UserWithPubKey structs which indicates who will have access (and management rights) to the created KVDB
publicMeta
privmx.endpoint.core.Buffer
public (unencrypted) metadata
privateMeta
privmx.endpoint.core.Buffer
private (encrypted) metadata
policies
privmx.endpoint.core.ContainerPolicy?
KVDB’s policies
Returns
std.string
·
Id of the created KVDB
updateKvdb(kvdbId:users:managers:publicMeta:privateMeta:version:force:forceGenerateNewKey:policies:)
Updates an existing KVDB.
Params
kvdbId
std.string
ID of the KVDB to update
users
privmx.UserWithPubKeyVector
array of UserWithPubKey structs which indicates who will have access to the created KVDB
managers
privmx.UserWithPubKeyVector
array of UserWithPubKey structs which indicates who will have access (and management rights) to the created KVDB
publicMeta
privmx.endpoint.core.Buffer
public (unencrypted) metadata
privateMeta
privmx.endpoint.core.Buffer
private (encrypted) metadata
version
Int64
current version of the updated KVDB
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(kvdbId:)
Deletes a KVDB by given KVDB ID.
Params
kvdbId
std.string
ID of the KVDB to delete
hasEntry(kvdbId:key:)
Check whether the KVDB entry exists.
Params
kvdbId
std.string
KVDB ID of the KVDB entry to check
key
std.string
key of the KVDB entry to check
Returns
Bool
·
‘true’ if the KVDB has an entry with given key, ‘false’ otherwise
getKvdb(kvdbId:)
Gets a KVDB by given KVDB ID.
Params
kvdbId
std.string
ID of KVDB to get
Returns
privmx.endpoint.kvdb.Kvdb
·
struct containing info about the KVDB
listKvdbs(contextId:pagingQuery:)
Gets a list of Kvdbs in given Context.
Params
contextId
std.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
getEntry(kvdbId:key:)
Gets a KVDB entry by given KVDB entry key and KVDB ID.
Params
kvdbId
std.string
KVDB ID of the KVDB entry to get
key
std.string
key of the KVDB entry to get
Returns
privmx.endpoint.kvdb.KvdbEntry
·
struct containing the KVDB entry
listEntriesKeys(kvdbId:pagingQuery:)
Gets a list of KVDB entries keys from a KVDB.
Params
kvdbId
std.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(kvdbId:pagingQuery:)
Gets a list of KVDB entries from a KVDB.
Params
kvdbId
std.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(kvdbId:key:publicMeta:privateMeta:data:version:)
Sets a KVDB entry in the given KVDB.
Params
kvdbId
std.string
ID of the KVDB to set the entry to
key
std.string
KVDB entry key
publicMeta
privmx.endpoint.core.Buffer
public KVDB entry metadata
privateMeta
privmx.endpoint.core.Buffer
private KVDB entry metadata
data
privmx.endpoint.core.Buffer
content of the KVDB entry
version
Int64
Returns
`` · ID of the new KVDB entry
deleteEntry(kvdbId:key:)
Deletes a KVDB entry by given KVDB entry ID.
Params
kvdbId
std.string
KVDB ID of the KVDB entry to delete
key
std.string
key of the KVDB entry to delete
deleteEntries(kvdbId:keys:)
Deletes KVDB entries by given KVDB IDs and the list of entry keys.
Params
kvdbId
std.string
ID of the KVDB database to delete from
keys
privmx.StringVector
vector of the keys of the KVDB entries to delete
Returns
privmx.StringBoolMap
·
map with the statuses of deletion for every key
subscribeForKvdbEvents()
Subscribes for the KVDB module main events.
unsubscribeFromKvdbEvents()
Unsubscribes from the KVDB module main events.
subscribeForEntryEvents(kvdbId:)
Subscribes for events in given KVDB.
Params
kvdbId
std.string
ID of the KVDB to subscribe
unsubscribeFromEntryEvents(kvdbId:)
Unsubscribes from events in given KVDB.
Params
kvdbId
std.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.