← Back to Kairo Docs|API Reference (Dokka)

Package-level declarations

Types

Link copied to clipboard
class ConfigResolver(val prefix: String, val resolve: suspend (raw: String) -> String?)

Config resolvers let you dynamically resolve config string values. String values that start with prefix will be mapped through resolve.

Functions

Link copied to clipboard
fun configName(configName: String, prefix: String = "config"): String

Builds a resource path for a config file (for example "config/production.conf").

Link copied to clipboard
inline suspend fun <T : Any> loadConfig(configName: String = configName(requireNotNull(System.getenv("CONFIG")) { "CONFIG environment variable not set." }), resolvers: List<ConfigResolver> = emptyList(), json: KairoJson = KairoJson()): T

Loads and deserializes a HOCON config file from the classpath. Uses the CONFIG environment variable by default. Config resolvers (for example for GCP secret resolution) are applied after loading.

suspend fun <T : Any> loadConfig(configName: String, resolvers: List<ConfigResolver> = emptyList(), json: KairoJson = KairoJson(), type: KairoType<T>): T