Config

zio.Config
See theConfig companion object
sealed trait Config[+A]

A zio.Config describes the structure of some configuration data.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Composite[A]
class Described[A]
class Fallback[A]
class FallbackWith[A]
class Optional[A]
class Lazy[A]
class MapOrFail[A, B]
class Nested[A]
class Sequence[A]
class Switch[A, B]
class Table[V]
class Zipped[A, B, C]
trait Primitive[A]
object Bool.type
class Constant[A]
object Decimal.type
object Duration.type
class Fail
object Integer.type
object LocalDate.type
object LocalDateTime.type
object LocalTime.type
object OffsetDateTime.type
object SecretType.type
object Text.type
Show all
Self type
Config[A]

Members list

Value members

Concrete methods

def ++[B](that: => Config[B])(implicit zippable: Zippable[A, B]): Config[Out]

Returns a new config that is the composition of this config and the specified config.

Returns a new config that is the composition of this config and the specified config.

Attributes

def ??(label: => String): Config[A]

Adds a description to this configuration, which is intended for humans.

Adds a description to this configuration, which is intended for humans.

Attributes

def map[B](f: A => B): Config[B]

Returns a new config whose structure is the same as this one, but which produces a different Scala value, constructed using the specified function.

Returns a new config whose structure is the same as this one, but which produces a different Scala value, constructed using the specified function.

Attributes

def mapAttempt[B](f: A => B): Config[B]

Returns a new config whose structure is the same as this one, but which may produce a different Scala value, constructed using the specified function, which may throw exceptions that will be translated into validation errors.

Returns a new config whose structure is the same as this one, but which may produce a different Scala value, constructed using the specified function, which may throw exceptions that will be translated into validation errors.

Attributes

def mapOrFail[B](f: A => Either[Error, B]): Config[B]

Returns a new config whose structure is the same as this one, but which may produce a different Scala value, constructed using the specified fallible function.

Returns a new config whose structure is the same as this one, but which may produce a different Scala value, constructed using the specified fallible function.

Attributes

def nested(name: => String): Config[A]

Returns a new config that has this configuration nested as a property of the specified name.

Returns a new config that has this configuration nested as a property of the specified name.

Attributes

def nested(name: => String, names: String*): Config[A]

Returns a new config that has this configuration nested as a property of the specified name.

Returns a new config that has this configuration nested as a property of the specified name.

Attributes

Returns an optional version of this config, which will be None if the data is missing from configuration, and Some otherwise.

Returns an optional version of this config, which will be None if the data is missing from configuration, and Some otherwise.

Attributes

def orElse[A1 >: A](that: => Config[A1]): Config[A1]

A named version of ||.

A named version of ||.

Attributes

def orElseIf(condition: Error => Boolean): OrElse[A]

Returns configuration which reads from this configuration, but which falls back to the specified configuration if reading from this configuration fails with an error satisfying the specified predicate.

Returns configuration which reads from this configuration, but which falls back to the specified configuration if reading from this configuration fails with an error satisfying the specified predicate.

Attributes

def repeat: Config[Chunk[A]]

Returns a new config that describes a sequence of values, each of which has the structure of this config.

Returns a new config that describes a sequence of values, each of which has the structure of this config.

Attributes

def switch[A1 >: A, B](f: (A1, Config[B])*): Config[B]

Returns a new configuration which reads from this configuration and uses the resulting value to determine the configuration to read from.

Returns a new configuration which reads from this configuration and uses the resulting value to determine the configuration to read from.

Attributes

def validate(message: => String)(f: A => Boolean): Config[A]

Returns a new config that describes the same structure as this one, but which performs validation during loading.

Returns a new config that describes the same structure as this one, but which performs validation during loading.

Attributes

def validateWith[B](message: => String)(pf: PartialFunction[A, B]): Config[B]

Returns a new config whose structure is the same as this one, but which may produce a different Scala value, constructed using the specified partial function, failing with the specified validation error if the partial function is not defined.

Returns a new config whose structure is the same as this one, but which may produce a different Scala value, constructed using the specified partial function, failing with the specified validation error if the partial function is not defined.

Attributes

def withDefault[A1 >: A](default: => A1): Config[A1]

Returns a new config that describes the same structure as this one, but has the specified default value in case the information cannot be found.

Returns a new config that describes the same structure as this one, but has the specified default value in case the information cannot be found.

Attributes

def zip[B](that: => Config[B])(implicit z: Zippable[A, B]): Config[Out]

A named version of ++.

A named version of ++.

Attributes

def zipWith[B, C](that: => Config[B])(f: (A, B) => C): Config[C]

Returns a new configuration that is the composition of this configuration and the specified configuration, combining their values using the function f.

Returns a new configuration that is the composition of this configuration and the specified configuration, combining their values using the function f.

Attributes

def ||[A1 >: A](that: => Config[A1]): Config[A1]

Returns a config whose structure is preferentially described by this config, but which falls back to the specified config if there is an issue reading from this config.

Returns a config whose structure is preferentially described by this config, but which falls back to the specified config if there is an issue reading from this config.

Attributes