scConfigDsl
is a minimal wrapper around the most important functions of Typesafe Config for Scala. It provides a very natural DSL to access sections and keys of the configuration.
Available in the central repository.
To use the library with sbt:
libraryDependencies += "org.hbel" % "scconfigdsl_2.12" % "0.1.1"
Simple usage examples:
Creating a new configuration instance
val cfg = new Config
Getting a sub-section of the configuration:
cfg / "foo" / "bar"
Getting a specific key (type inferred from variable type)
val key : Option[String] = cfg / "foo" / "bar" % "key"
Tyoe inferred from getOrElse call
val intValue = cfg / "foo" / "bar" % "key" getOrElse(0)
Getting the names of all direct child elements of a config:
val childElements = cfg children