StoreApi

expect class StoreApi(connection: Connection) : AutoCloseable

Manages PrivMX Bridge Stores and Files.

Parameters

connection

active connection to PrivMX Bridge

Throws

when given Connection is not connected

actual class StoreApi(connection: Connection) : AutoCloseable

Manages PrivMX Bridge Stores and Files.

Parameters

connection

active connection to PrivMX Bridge

Throws

when given Connection is not connected

actual class StoreApi(connection: Connection) : AutoCloseable

Manages PrivMX Bridge Stores and Files.

Parameters

connection

active connection to PrivMX Bridge

Throws

when given Connection is not connected

Constructors

Link copied to clipboard
expect constructor(connection: Connection)
actual constructor(connection: Connection)
actual constructor(connection: Connection)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
expect open override fun close()

Frees memory.

actual open override fun close()

Frees memory.

actual open override fun close()

Frees memory.

Link copied to clipboard
expect fun closeFile(fileHandle: Long): String

Closes the file handle.

actual fun closeFile(fileHandle: Long): String

Closes the file handle.

actual external fun closeFile(fileHandle: Long): String

Closes the file handle.

Link copied to clipboard
expect fun createFile(storeId: String, publicMeta: ByteArray, privateMeta: ByteArray, size: Long): Long?

Creates a new file in a Store.

actual fun createFile(storeId: String, publicMeta: ByteArray, privateMeta: ByteArray, size: Long): Long?

Creates a new file in a Store.

actual external fun createFile(storeId: String, publicMeta: ByteArray, privateMeta: ByteArray, size: Long): Long?

Creates a new file in a Store.

Link copied to clipboard
expect fun createStore(contextId: String, users: List<UserWithPubKey>, managers: List<UserWithPubKey>, publicMeta: ByteArray, privateMeta: ByteArray, policies: ContainerPolicy? = null): String

Creates a new Store in given Context.

actual fun createStore(contextId: String, users: List<UserWithPubKey>, managers: List<UserWithPubKey>, publicMeta: ByteArray, privateMeta: ByteArray, policies: ContainerPolicy?): String

Creates a new Store in given Context.

actual external fun createStore(contextId: String, users: List<UserWithPubKey>, managers: List<UserWithPubKey>, publicMeta: ByteArray, privateMeta: ByteArray, policies: ContainerPolicy?): String

Creates a new Store in given Context.

Link copied to clipboard
expect fun deleteFile(fileId: String)

Deletes a file by given ID.

actual fun deleteFile(fileId: String)

Deletes a file by given ID.

actual external fun deleteFile(fileId: String)

Deletes a file by given ID.

Link copied to clipboard
expect fun deleteStore(storeId: String)

Deletes a Store by given Store ID.

actual fun deleteStore(storeId: String)

Deletes a Store by given Store ID.

actual external fun deleteStore(storeId: String)

Deletes a Store by given Store ID.

Link copied to clipboard
expect fun getFile(fileId: String): File

Gets a single file by the given file ID.

actual fun getFile(fileId: String): File

Gets a single file by the given file ID.

actual external fun getFile(fileId: String): File

Gets a single file by the given file ID.

Link copied to clipboard
expect fun getStore(storeId: String): Store

Gets a single Store by given Store ID.

actual fun getStore(storeId: String): Store

Gets a single Store by given Store ID.

actual external fun getStore(storeId: String): Store

Gets a single Store by given Store ID.

Link copied to clipboard
expect fun listFiles(storeId: String, skip: Long, limit: Long, sortOrder: String = "desc", lastId: String? = null): PagingList<File>

Gets a list of files in given Store.

actual fun listFiles(storeId: String, skip: Long, limit: Long, sortOrder: String, lastId: String?): PagingList<File>

Gets a list of files in given Store.

actual external fun listFiles(storeId: String, skip: Long, limit: Long, sortOrder: String, lastId: String?): PagingList<File>

Gets a list of files in given Store.

Link copied to clipboard
expect fun listStores(contextId: String, skip: Long, limit: Long, sortOrder: String = "desc", lastId: String? = null): PagingList<Store>

Gets a list of Stores in given Context.

actual fun listStores(contextId: String, skip: Long, limit: Long, sortOrder: String, lastId: String?): PagingList<Store>

Gets a list of Stores in given Context.

actual external fun listStores(contextId: String, skip: Long, limit: Long, sortOrder: String, lastId: String?): PagingList<Store>

Gets a list of Stores in given Context.

Link copied to clipboard
expect fun openFile(fileId: String): Long?

Opens a file to read.

actual fun openFile(fileId: String): Long?

Opens a file to read.

actual external fun openFile(fileId: String): Long?

Opens a file to read.

Link copied to clipboard
expect fun readFromFile(fileHandle: Long, length: Long): ByteArray

Reads file data.

actual fun readFromFile(fileHandle: Long, length: Long): ByteArray

Reads file data.

actual external fun readFromFile(fileHandle: Long, length: Long): ByteArray

Reads file data.

Link copied to clipboard
expect fun seekInFile(fileHandle: Long, position: Long)

Moves read cursor.

actual fun seekInFile(fileHandle: Long, position: Long)

Moves read cursor.

actual external fun seekInFile(fileHandle: Long, position: Long)

Moves read cursor.

Link copied to clipboard
expect fun subscribeForFileEvents(storeId: String)

Subscribes for events in given Store.

actual fun subscribeForFileEvents(storeId: String)

Subscribes for events in given Store.

actual external fun subscribeForFileEvents(storeId: String)

Subscribes for events in given Store.

Link copied to clipboard

Subscribes for the Store module main events.

Subscribes for the Store module main events.

actual external fun subscribeForStoreEvents()

Subscribes for the Store module main events.

Link copied to clipboard
expect fun unsubscribeFromFileEvents(storeId: String)

Unsubscribes from events in given Store.

actual fun unsubscribeFromFileEvents(storeId: String)

Unsubscribes from events in given Store.

actual external fun unsubscribeFromFileEvents(storeId: String)

Unsubscribes from events in given Store.

Link copied to clipboard

Unsubscribes from the Store module main events.

Unsubscribes from the Store module main events.

actual external fun unsubscribeFromStoreEvents()

Unsubscribes from the Store module main events.

Link copied to clipboard
expect fun updateFile(fileId: String, publicMeta: ByteArray, privateMeta: ByteArray, size: Long): Long?

Updates an existing file in a Store.

actual fun updateFile(fileId: String, publicMeta: ByteArray, privateMeta: ByteArray, size: Long): Long?

Updates an existing file in a Store.

actual external fun updateFile(fileId: String, publicMeta: ByteArray, privateMeta: ByteArray, size: Long): Long?

Updates an existing file in a Store.

Link copied to clipboard
expect fun updateFileMeta(fileId: String, publicMeta: ByteArray, privateMeta: ByteArray)

Updates metadata of an existing file in a Store.

actual fun updateFileMeta(fileId: String, publicMeta: ByteArray, privateMeta: ByteArray)

Updates metadata of an existing file in a Store.

actual external fun updateFileMeta(fileId: String, publicMeta: ByteArray, privateMeta: ByteArray)

Updates metadata of an existing file in a Store.

Link copied to clipboard
expect fun updateStore(storeId: String, users: List<UserWithPubKey>, managers: List<UserWithPubKey>, publicMeta: ByteArray, privateMeta: ByteArray, version: Long, force: Boolean = false, forceGenerateNewKey: Boolean = false, policies: ContainerPolicy? = null)

Updates an existing Store.

actual fun updateStore(storeId: String, users: List<UserWithPubKey>, managers: List<UserWithPubKey>, publicMeta: ByteArray, privateMeta: ByteArray, version: Long, force: Boolean, forceGenerateNewKey: Boolean, policies: ContainerPolicy?)

Updates an existing Store.

actual external fun updateStore(storeId: String, users: List<UserWithPubKey>, managers: List<UserWithPubKey>, publicMeta: ByteArray, privateMeta: ByteArray, version: Long, force: Boolean, forceGenerateNewKey: Boolean, policies: ContainerPolicy?)

Updates an existing Store.

Link copied to clipboard
expect fun writeToFile(fileHandle: Long, dataChunk: ByteArray)

Writes a file data.

actual fun writeToFile(fileHandle: Long, dataChunk: ByteArray)

Writes a file data.

actual external fun writeToFile(fileHandle: Long, dataChunk: ByteArray)

Writes a file data.