zio-config
zio-config copied to clipboard
Integrate with config front-end in ZIO 2.0.4
ZIO 2.0.4 provides a config front-end, which can be used to describe the format of configuration data.
ZIO Config should integrate cleanly into this configuration front-end, providing the ability to supply ConfigProvider
for the front-end, as well as declaratively specify how multiple, disparate, disjointed or maybe even overlapping configuration sources collectively provide all of the configuration requirements of the application.
Several points of integration must be determined:
- Should
zio.Config
replaceConfigDescriptor
, or should it be possible to derivezio.Config
fromConfigDescriptor
? - If we delete
ConfigDescriptor
, how does this affect read, document, generateReport, and write? - Do we need
ConfigSource
, or can we instead use theConfigProvider
, maybe in a layer? - What does the user interface look like for using ZIO Config providers?
- Can ZIO Config derive
Config
from data types, just like it can now deriveConfigDescriptor
from ADTs?
It would be nice to have an interop with pureconfig
's ConfigReader
.
@afsalthaj and I discussed the following plan:
- Remove everything in
zio.config._
, except for the documentation part, which can be retrofitted to work withzio.Config
andzio.ConfigProvider
. - Refactor integrations to use
Config
instead ofConfigDescriptor
, andConfigProvider
instead ofConfigSource
. - Possibly, add missing methods to
zio.ConfigProvider
orzio.Config
. - Refactor each integration into a layer
ZLayer[Any, Nothing, Unit]
, which installs its config provider. So, for example, the hocon integration would expose a layer that can be incorporated into an app to install the HOCON config provider. - Release this as ZIO Config 4.0.0.