storeOf

inline fun <T : @Serializable Any> storeOf(file: Path, version: Int, default: T? = null, enableCache: Boolean = true, json: Json = DefaultJson, versionPath: Path = Path("$file.version"), noinline migration: Migration<T> = DefaultMigration(default)): KStore<T>

Creates a store with a versioned encoder and decoder Note: An additional file will be written to manage metadata on the same path with .version suffix

Return

store that contains a value of type T

Parameters

file

path to the file that is managed by this store

default

returns this value if the file is not found. defaults to null

enableCache

maintain a cache. If set to false, it always reads from disk

json

Serializer to use. Defaults serializer ignores unknown keys and encodes the defaults

versionPath

path to the file that contains the current version of the store

migration

Migration strategy to use. Defaults