Trait

zio.config.ConfigSourceModule

ConfigSource

Related Doc: package ConfigSourceModule

Permalink

trait ConfigSource extends AnyRef

Self Type
ConfigSource
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ConfigSource
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def getConfigValue(keys: List[ConfigSourceModule.K]): PropertyTree[ConfigSourceModule.K, ConfigSourceModule.V]

    Permalink
  2. abstract def leafForSequence: LeafForSequence

    Permalink
  3. abstract def names: Set[ConfigSourceName]

    Permalink

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def <>(that: ⇒ ConfigSource): ConfigSource

    Permalink

    <> is an alias to orElse.

    <> is an alias to orElse. Try this (configSource), and if it fails, try that (configSource)

    For example:

    Given three configSources, configSource1, configSource2 and configSource3, such that configSource1 and configSource2 will only have id and configSource3 act as a global fall-back source.

    The following config tries to fetch Id from configSource1, and if fails, it tries configSource2, and if both fails it gets from configSource3. Age will be fetched only from configSource3.

    val config = (string("Id") from (configSource1 orElse configSource2) |@| int("Age"))(Person.apply, Person.unapply)
    read(config from configSource3)
  4. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def convertKeys(f: (ConfigSourceModule.K) ⇒ ConfigSourceModule.K): ConfigSource

    Permalink

    Convert the keys before it is queried from ConfigSource.

    Convert the keys before it is queried from ConfigSource.

    For example:

    Given two configSources, configSource1 and configSource2, such that configSource1 can have uppercase ID and lowercase age, and configSource2 can have lowercase ID and uppercase age.

    The following solution will not help here, as you would imagine. config.mapKeys(_.toUpperCase) from configSource1 orElse config.mapKeys(_.toLowerCase) from configSource2)

    A correct solution here would be the following, indicating the fact configSources act differently for different fields.

    val idSource = configSource1.convertKeys(_.toUpperCase) <> configSource2.convertKeys(_.toLowerCase)
    val ageSource = configSource1.convertKeys(_.toLowerCase) <> configSource2.convertKeys(_.toUpperCase)
    
    val config = (string("Id") from idSource |@| int("Age") from ageSource)(Person.apply, Person.unapply)
    read(config)
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  12. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  13. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. def orElse(that: ⇒ ConfigSource): ConfigSource

    Permalink

    Try this (configSource), and if it fails, try that (configSource)

    Try this (configSource), and if it fails, try that (configSource)

    For example:

    Given three configSources, configSource1, configSource2 and configSource3, such that configSource1 and configSource2 will only have id and configSource3 act as a global fall-back source.

    The following config tries to fetch Id from configSource1, and if fails, it tries configSource2, and if both fails it gets from configSource3. Age will be fetched only from configSource3.

    val config = (string("Id") from (configSource1 orElse configSource2) |@| int("Age"))(Person.apply, Person.unapply)
    read(config from configSource3)
  18. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  19. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  20. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped