Packages

  • package root

    This is the API documentation for Ciris: lightweight, extensible, and validated configuration loading in Scala.
    The documentation is kept up-to-date with new releases, currently documenting release v0.12.0 on Scala 2.12.
    Please note that the documentation targets the JVM, and there may be differences on Scala.js and Scala Native.

    This is the API documentation for Ciris: lightweight, extensible, and validated configuration loading in Scala.
    The documentation is kept up-to-date with new releases, currently documenting release v0.12.0 on Scala 2.12.
    Please note that the documentation targets the JVM, and there may be differences on Scala.js and Scala Native.

    Ciris is divided into the following set of modules.

    • The cats module integrates with cats for type classes and type class instances.
    • The cats-effect module integrates with cats-effect for type classes for effect types.
    • The core module provides basic functionality and support for standard library types.
    • The enumeratum module integrates with enumeratum to be able to read enumerations.
    • The generic module uses shapeless to be able to read products and coproducts.
    • The refined module integrates with refined to be able to read refinement types.
    • The spire module integrates with spire to be able to read more number types.
    • The squants module integrates with squants to read values with unit of measure.

    If you're looking for usage instructions, please refer to the usage guide.

    Definition Classes
    root
  • package ciris

    The main namespace of Ciris is ciris, and the easiest way to get started is to bring it into scope with an import.
    If you are looking for a getting started guide, with examples and explanations, please refer to the usage guide.

    The main namespace of Ciris is ciris, and the easiest way to get started is to bring it into scope with an import.
    If you are looking for a getting started guide, with examples and explanations, please refer to the usage guide.

    Definition Classes
    root
  • package api
    Definition Classes
    ciris
  • package cats

    Module providing an integration with cats.

    Module providing an integration with cats.

    Definition Classes
    ciris
  • package decoders
    Definition Classes
    ciris
  • package enumeratum

    Module providing an integration with enumeratum.

    Module providing an integration with enumeratum.

    Definition Classes
    ciris
  • package generic

    Module using shapeless for generic derivation of ConfigDecoders.

    Module using shapeless for generic derivation of ConfigDecoders.

    Definition Classes
    ciris
  • package refined

    Module providing an integration with refined.

    Module providing an integration with refined.

    Definition Classes
    ciris
  • package spire

    Module providing an integration with spire.

    Module providing an integration with spire.

    Definition Classes
    ciris
  • package squants

    Module providing an integration with squants.

    Module providing an integration with squants.

    Definition Classes
    ciris
  • ConfigDecoder
  • ConfigEntry
  • ConfigError
  • ConfigErrors
  • ConfigException
  • ConfigKeyType
  • ConfigResult
  • ConfigSource
  • ConfigValue
  • Secret

abstract class ConfigValue[F[_], V] extends ConfigResult[F, V]

ConfigValue represents the value part of a ConfigEntry, without any other details like the key, key type, or original source value. ConfigEntry extends ConfigValue, but you can also create one with ConfigValue#apply.

F

the context in which the value exists

V

the type of the value

Source
ConfigValue.scala
Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ConfigValue
  2. ConfigResult
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ConfigValue()(implicit arg0: Apply[F])

Abstract Value Members

  1. abstract def value: F[Either[ConfigError, V]]

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def orElse(that: ⇒ ConfigValue[F, V])(implicit m: Monad[F]): ConfigValue[F, V]

    If the key for this value was missing from the ConfigSource, as determined by ConfigError.isMissingKey, then uses that ConfigValue instead.

    If the key for this value was missing from the ConfigSource, as determined by ConfigError.isMissingKey, then uses that ConfigValue instead. If that value is not available due to an error, then the errors are accumulated.

    scala> val apiKey =
         |  env[String]("API_KEY").
         |    orElse(prop("api.key"))
    apiKey: ConfigValue[api.Id, String] = ConfigValue$$1815631407
    
    scala> apiKey.value.left.map(_.message).toString
    res0: String = Left(Missing environment variable [API_KEY] and missing system property [api.key])
    
    scala> env[String]("FILE_ENCODING").
         |   orElse(prop("file.encoding")).
         |   toStringWithValue
    res1: String = ConfigValue(Right(UTF8))

    If the value is unavailable due to a different error than the key missing from the ConfigSource, then the alternative value will not be used.

    scala> prop[Int]("file.encoding").
         |   orElse(env("FILE_ENCODING")).
         |   toStringWithValue
    res2: String = ConfigValue(Left(WrongType(file.encoding, Property, Right(UTF8), UTF8, Int, java.lang.NumberFormatException: For input string: "UTF8")))

    Note that the alternative value is passed by reference, and it will only be evaluated if this ConfigValue is unavailable due to the key missing from the ConfigSource.

    that

    the ConfigValue to use if this value is unavailable due to the key missing from the ConfigSource

    returns

    a new ConfigValue

  16. final def orNone: ConfigValue[F, Option[V]]

    If the key for this value was missing from the ConfigSource, as determined by ConfigError.isMissingKey, then uses None as value instead.

    If the key for this value was missing from the ConfigSource, as determined by ConfigError.isMissingKey, then uses None as value instead. If the value is available, it gets wrapped in a Some.

    scala> env[String]("API_KEY").
         |   orElse(prop("api.key")).
         |   orNone.
         |   toStringWithValue
    res0: String = ConfigValue(Right(None))

    If the value is unavailable due to a different error than the key missing from the ConfigSource, then the error will not be replaced with None.

    scala> prop[Int]("file.encoding").orNone.toStringWithValue
    res1: String = ConfigValue(Left(WrongType(file.encoding, Property, Right(UTF8), UTF8, Int, java.lang.NumberFormatException: For input string: "UTF8")))
    returns

    a new ConfigValue

  17. final def orRaiseErrors(implicit F: MonadError[F, ConfigErrors]): F[V]
    Definition Classes
    ConfigResult
  18. final def orRaiseThrowable(implicit F: MonadError[F, Throwable]): F[V]
    Definition Classes
    ConfigResult
  19. final def orThrow()(implicit ev: =:=[F[Either[ConfigErrors, V]], Either[ConfigErrors, V]]): V
    Definition Classes
    ConfigResult
  20. final def result: F[Either[ConfigErrors, V]]

    Returns the result of having loaded a configuration using this ConfigValue.

    Returns the result of having loaded a configuration using this ConfigValue. This effectively only wraps errors from value in ConfigErrors.

    returns

    the configuration loading result using this value

    Definition Classes
    ConfigValueConfigResult
  21. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  22. def toString(): String
    Definition Classes
    ConfigValueConfigResult → AnyRef → Any
  23. def toStringWithResult: String

    Returns a String representation of this ConfigResult including the result.

    Returns a String representation of this ConfigResult including the result. If the result is potentially sensitive, then be careful to not include it in log output.

    returns

    a String representation with the result

    Definition Classes
    ConfigValueConfigResult
  24. def toStringWithValue: String

    Returns a String representation of this ConfigValue including the value.

    Returns a String representation of this ConfigValue including the value. If the value is potentially sensitive, then be careful to not include it in log output.

    returns

    a String representation with the value

  25. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from ConfigResult[F, V]

Inherited from AnyRef

Inherited from Any

Ungrouped