Storage

object Storage

Entry point for all Key-Value Storage instances.

Use the factory methods on this object to obtain a Kvs or KvsExtended instance:

  • inMemoryKvs — volatile, no disk I/O; available from kvs-core alone.

  • Storage.kvsLight(...) — DataStore-backed; provided by the kvs-persistence-light artifact.

  • Storage.kvsOptimized(...) — SQLDelight-backed; provided by kvs-persistence-optimized.

  • Storage.document(...) — single-document JSON storage; provided by kvs-document.

Call debug before creating any instance to enable verbose logging during development.

Storage.debug(BuildConfig.DEBUG)
val kvs = Storage.inMemoryKvs("session")

Functions

Link copied to clipboard
fun debug(isDebug: Boolean)

Enables or disables verbose debug logging for all Storage backends.

Link copied to clipboard
fun inMemoryKvs(name: String): Kvs

Returns an in-memory Kvs instance identified by name.