Sugar for creating ConfigReaders
Generally used for companion objects that can provide configured implementations
Simple user-friendly wrapper around Config.
Simple user-friendly wrapper around Config.
Provides a single type-safe apply method for getting values out from the configuration.
Usage:
val config = Configuration.load("filename.conf").get[Configuration]("objectName") val intThing = config[Int]("intPropertyName") val strThing = config[String]("stringPropertyName")
Note that formatting or other problems will throw exceptions.
You can also optionally find correct config items or validate and check their correctness (with Either):
val intOption:Option[Int] = config.option[Int]("intPropertyName") val strThing: Either[Throwable, String] = config.valid[String]("stringPropertyName")
The Accessor type-classes implement the glue to get the specific type configuration item.
Details on the underlying configuration file specification can be found here: https://github.com/typesafehub/config/blob/master/HOCON.md
Used to extract scala object instances that implement some provider style interface.
Used to extract scala object instances that implement some provider style interface.
Use:
config[Module[Foo]]("name").get
where Foo is the trait that your object implements, and 'name' is config property that holds the name of the actual object