storeOf

inline fun <T : @Serializable Any> storeOf(file: Path, default: T? = null, enableCache: Boolean = true, json: Json = DefaultJson): KStore<T>

Creates a store with FileCodec

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

JSON Serializer to use. defaults to DefaultJson


inline fun <T : @Serializable Any> storeOf(codec: Codec<T>, default: T? = null, enableCache: Boolean = true): KStore<T>

Creates a store with a given codec

Return

store that contains a value of type T

Parameters

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

codec

codec to be used.