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 cats

    Module providing an integration with cats.

    Module providing an integration with cats.

    Definition Classes
    ciris
  • package effect

    Module providing an integration with cats-effect.

    Module providing an integration with cats-effect.

    Definition Classes
    cats
  • object syntax
    Definition Classes
    effect
  • CatsEffectConfigSourceIdSyntax
c

ciris.cats.effect.syntax

CatsEffectConfigSourceIdSyntax

final class CatsEffectConfigSourceIdSyntax[K, V] extends AnyVal

Source
syntax.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CatsEffectConfigSourceIdSyntax
  2. AnyVal
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  2. final def ##(): Int
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def getClass(): Class[_ <: AnyVal]
    Definition Classes
    AnyVal → Any
  6. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  7. val source: ConfigSource[Id, K, V]
  8. def suspendMemoizeF[F[_]](implicit F: Concurrent[F]): ConfigSource[[v]F[F[v]], K, V]

    Suspends the reading of this configuration source into a context F, while also memoizing values.

    Suspends the reading of this configuration source into a context F, while also memoizing values. Since memoization itself is an effect, values read from the source will be wrapped in two Fs, with the first effect being for memoization.

    scala> import cats.effect._,
         |   ciris._,
         |   ciris.cats._,
         |   ciris.cats.effect.syntax._
    
    scala> import scala.concurrent.ExecutionContext.global
    
    scala> implicit val contextShift: ContextShift[IO] = IO.contextShift(global)
    contextShift: ContextShift[IO] = [email protected]201ac0ef
    
    scala> val source = ConfigSource(ConfigKeyType[String]("key type")) { key =>
         |   Right(s"$$key: $${new java.util.Random().nextInt()}")
         | }.suspendMemoizeF[IO]
    source: ConfigSource[[v]cats.effect.IO[cats.effect.IO[v]],String,String] = ConfigSource(ConfigKeyType(key type))
    
    scala> val memoizedValue = source.read("key").value
    memoizedValue: cats.effect.IO[cats.effect.IO[Either[ciris.ConfigError,String]]] = IO$$1699125381
    
    scala> val twiceEqual =
         |   for {
         |     memoized <- memoizedValue
         |     value1 <- memoized
         |     value2 <- memoized
         |   } yield value1 == value2
    twiceEqual: cats.effect.IO[Boolean] = IO$$1049599874
    
    scala> twiceEqual.unsafeRunSync()
    res0: Boolean = true
    F

    the context in which to suspend and memoize

    returns

    a new ConfigSource

  9. def toString(): String
    Definition Classes
    Any

Inherited from AnyVal

Inherited from Any

Ungrouped