ConfigDef

trait ConfigDef[A] extends FailableFunctor[ConfigDef, A]

Representation the desire to read A from some as-of-yet-unspecified config.

Companion:
object
class Object
trait Matchable
class Any

Value members

Abstract methods

def ap[B](f: ConfigDef[A => B]): ConfigDef[B]
def chooseAttempt[B](f: A => Either[String, ConfigDef[B]]): ConfigDef[B]
def run[F[_]](sources: Sources[F])(implicit pp: ValuePreprocessor, F: Monad[F]): F[Result[A]]

When a Report is generated, the config values used by this will be obfuscated.

When a Report is generated, the config values used by this will be obfuscated.

Requires at least one key to be externally specified, else None is returned.

Requires at least one key to be externally specified, else None is returned.

If some keys are available and some required others are not, then it is a failure.

If enough config is specified to construct an instance, it is provided wrapped in Some(_), else None is returned.

If enough config is specified to construct an instance, it is provided wrapped in Some(_), else None is returned.

Unlike option / whenAtLeastOneKeySpecified, this never fails.

def withKeyMod(f: String => String): ConfigDef[A]
def withReport(implicit s: Settings): ConfigDef[(A, Report)]

Generate a report based on the usage so far. This should be at the very end of your Config composition, else the unused-keys portion of the report may be inaccurate.

Generate a report based on the usage so far. This should be at the very end of your Config composition, else the unused-keys portion of the report may be inaccurate.

Concrete methods

final def choose[B](f: A => ConfigDef[B]): ConfigDef[B]

Use this method very sparingly as it prevents clarity and config discoverability by introducing configuration keys that only appear in certain conditions.

Use this method very sparingly as it prevents clarity and config discoverability by introducing configuration keys that only appear in certain conditions.

final def chooseWhenDefined[B, C](f: B => ConfigDef[C])(implicit ev: A =:= Option[B]): ConfigDef[Option[C]]

Opens up a new bunch of config opens when some other option config value is defined.

Opens up a new bunch of config opens when some other option config value is defined.

It's recommended not to use this function in most cases because it hides the optional config from reports when it's not enabled. Where as when a user decides to enable the feature they often want to know what the additional, potentially-mandatory options are. This function makes that an unclear, two-step process.

final def withPrefix(prefix: String): ConfigDef[A]

Deprecated methods

@deprecated("Use .whenAtLeastOneKeySpecified", "3.1.0")
final def option: ConfigDef[Option[A]]

Requires at least one key to be externally specified, else None is returned.

Requires at least one key to be externally specified, else None is returned.

If some keys are available and some required others are not, then it is a failure.

Deprecated

Inherited methods

def ensure(test: A => Boolean, errorMsg: => String): ConfigDef[A]
Inherited from:
FailableFunctor
final def ensure_<(rhs: A)(implicit o: Ordering[A]): ConfigDef[A]
Inherited from:
FailableFunctor
final def ensure_<=(rhs: A)(implicit o: Ordering[A]): ConfigDef[A]
Inherited from:
FailableFunctor
final def ensure_>(rhs: A)(implicit o: Ordering[A]): ConfigDef[A]
Inherited from:
FailableFunctor
final def ensure_>=(rhs: A)(implicit o: Ordering[A]): ConfigDef[A]
Inherited from:
FailableFunctor
def map[B](f: A => B): ConfigDef[B]
Inherited from:
FailableFunctor
def mapAttempt[B](f: A => Either[String, B]): ConfigDef[B]
Inherited from:
FailableFunctor
def mapCatch[B](f: A => B, e: Throwable => String): ConfigDef[B]
Inherited from:
FailableFunctor
def mapOption[B](f: A => Option[B], errorMsg: => String): ConfigDef[B]
Inherited from:
FailableFunctor
def test(errorMsg: A => Option[String]): ConfigDef[A]
Inherited from:
FailableFunctor