Keystone

net.zagart.keystone — module: core

Module

ModuleArtifactTargets
:corenet.zagart.keystone:coreAndroid, JVM, iOS

Installation

commonMain.dependencies {
    implementation("net.zagart.keystone:core:X.Y.Z")
}

Basic Usage

val storage = Keystone.Storage.create(name = "my_app")

// Write
storage.putString("user", "name", "Alice")
storage.putBoolean("user", "notifications", true)

// Read
val name = storage.getString("user", "name", default = "Guest")

// Observe changes
storage.observe("user") {
    string("name")
    boolean("notifications")
}.collect { snapshot ->
    updateUI(snapshot)
}

Features

FeatureDetails
Scope-based storageOrganize data into named scopes (e.g. "settings", "user_profile")
Reactive observationObserve changes via Flow<Snapshot> using the DSL builder
Entity persistence@Entity-annotated classes persisted via SQLDelight with @Embedded flattening
Type-safe keysDefine keys and defaults using ObservationBuilder DSL
Compose-agnosticPure Kotlin — no Compose dependency

Platform Notes

Platformcreate() context
AndroidRequires Context as platformContext
iOSplatformContext = null
JVMplatformContext = null

Versioning & Releases

Follows Semantic Versioning.

  1. Update version in core/build.gradle.kts
  2. Run ./gradlew :core:publish
  3. Release from the Sonatype staging UI
  4. Tag and push: git tag vX.Y.Z && git push origin vX.Y.Z
← Back