Storage
interface Storage
Typed key-value storage interface with observation capabilities.
Provides methods for storing and retrieving primitive values grouped by named scopes, as well as entity persistence via serialization adapters. All mutating operations are suspend functions and should be called from a coroutine context.
Observations return Kotlin Flow instances that emit the current value(s) on every change.
Example:
val storage = Keystone.Storage.create(name = "my_app")
storage.putString("settings", "key", "value")
val value = storage.getString("settings", "key")
storage.observe("settings") { string("key") }.collect { /* react */}Content copied to clipboard
Functions
Link copied to clipboard
Link copied to clipboard
Clears all keys and entities within the given scope.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun observe(scope: String, block: Keystone.ObservationBuilder.() -> Unit): Flow<Keystone.Snapshot>
Link copied to clipboard
Observes all scopes, emitting a map from scope name to Snapshot on every change.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard