zio-config icon indicating copy to clipboard operation
zio-config copied to clipboard

Implement updateSourceAtKey

Open afsalthaj opened this issue 4 years ago • 2 comments

afsalthaj avatar Jun 24 '20 00:06 afsalthaj

@afsalthaj can you share here some more details ?

maciejbak85 avatar Jul 31 '20 12:07 maciejbak85

@maciejbak85 Apologies. I completely missed out your message.

As of now we have data source override capabilities. For example

case class MyConfig(username: String, password: String)

val someSource: ConfigSource = ???

val config: ConfigDescriptor[MyConfig] = descriptor[MyConfig] from someSource

config.updateSource(source => constantSource <> source)

This will override the data in someSource with constantSource for all keys in MyConfig. We need to be able to target per field. It's an enhancement, and not a critical feature. However, it will be really interesting to implement.

afsalthaj avatar Dec 01 '20 09:12 afsalthaj