Config

io.eezo.config.Config
See theConfig companion object
trait Config[A]

An application's own configuration, read from application.conf into a case class it declares.

The case class and the file are the whole contract. The class says what is read and what may be absent, through its defaults and its Options; the file says where each value comes from, either stated in it or fed from a variable through a substitution. A nested case class that derives Config is a section, read under the field's name, so the class's shape is the file's.

Absence is decided by the case class alone and never by Parser.absent. A form needs that answer, because a browser omits an unchecked checkbox, but a value nobody stated is a deployment that forgot something, so a Boolean nobody set is missing rather than quietly false.

Attributes

Companion
object
Source
Config.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def current: A

What a handler reads, as it reads a table: the value installed last.

What a handler reads, as it reads a table: the value installed last.

Attributes

Source
Config.scala
def install(value: A): Unit

What boot calls with the value it read. Every section is installed under its own Config too, so that code that needs one section asks for that section and not for the whole class.

What boot calls with the value it read. Every section is installed under its own Config too, so that code that needs one section asks for that section and not for the whole class.

Attributes

Source
Config.scala
def installed[R](value: A)(body: => R): R

A suite's scope: value, and every section of it, is current inside body, and what was installed before is back after, also when body throws.

A suite's scope: value, and every section of it, is current inside body, and what was installed before is back after, also when body throws.

Attributes

Source
Config.scala
def names(file: Config): Seq[Name]

Every variable the file names, in file order, without reading any of them: what a command can list for an operator before a deployment has a single one set. The file and not the class, because only the file says which variable feeds which path.

Every variable the file names, in file order, without reading any of them: what a command can list for an operator before a deployment has a single one set. The file and not the class, because only the file says which variable feeds which path.

Attributes

Source
Config.scala
def read(file: Config, env: Map[String, String] = ...): Either[Refused, A]

A pure function of the file as parsed, unresolved, and a map that stands for the environment. The default argument is the one place the process's environment is read, so a suite hands both and never touches the real one.

A pure function of the file as parsed, unresolved, and a map that stands for the environment. The default argument is the one place the process's environment is read, so a suite hands both and never touches the real one.

Attributes

Source
Config.scala

Concrete methods

def check(file: Config): Seq[Offender]

The offenders the file shows on its own, before any environment: a variable under the framework's prefix, and a Redacted stated as text. What a command checks for an operator who has set nothing yet, so a value no variable feeds yet is not one of them. The file is read twice. With every variable answered by text no environment holds, each path is fed and the read finds the two offenders at the leaves. With none answered, a variable that replaces a whole section stays unset, so the section stays a section and its literal leaf is still reached, as at boot with that variable unset. An unset variable is only a Missing there, and the filter drops it.

The offenders the file shows on its own, before any environment: a variable under the framework's prefix, and a Redacted stated as text. What a command checks for an operator who has set nothing yet, so a value no variable feeds yet is not one of them. The file is read twice. With every variable answered by text no environment holds, each path is fed and the read finds the two offenders at the leaves. With none answered, a variable that replaces a whole section stays unset, so the section stays a section and its literal leaf is still reached, as at boot with that variable unset. An unset variable is only a Missing there, and the filter drops it.

Attributes

Source
Config.scala