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 ConfigSource[F[_], K, V] extends AnyRef

ConfigSource represents the ability to read values of type V for keys of type K from some source: for example, environment variables, system properties, command-line arguments, or some vault service. The values are returned in a context F, which can be api.Id when no context is desired.

You can create a ConfigSource by directly extending the class and implementing ConfigSource#read, or by using any of the helpers in the companion object, like ConfigSource#apply.

The ConfigSources already defined in the Ciris core module include the following:
- ConfigSource#Environment: for reading environment variables,
- ConfigSource#Properties: for reading system properties, and
- ConfigSource.File: for reading file contents.

K

the type of keys the source supports

V

the type of values the source reads

Self Type
ConfigSource[F, K, V]
Source
ConfigSource.scala
Example:
  1. scala> val source = ConfigSource(ConfigKeyType[String]("identity key"))(key => Right(key))
    source: ConfigSource[api.Id, String, String] = ConfigSource(ConfigKeyType(identity key))
    
    scala> source.read("key").toStringWithValues
    res0: String = ConfigEntry(key, ConfigKeyType(identity key), Right(key))
Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ConfigSource
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ConfigSource(keyType: ConfigKeyType[K])

    keyType

    the name and type of keys the source supports

Abstract Value Members

  1. abstract def read(key: K): ConfigEntry[F, K, V, V]

    Reads the value of type V for the specified key of type K, and returns a ConfigEntry with the result wrapped in the context F.

    Reads the value of type V for the specified key of type K, and returns a ConfigEntry with the result wrapped in the context F. If there was an error while reading the value, ConfigEntry#value will have more details.

    key

    the key for which to read the value

    returns

    a ConfigEntry with the result

    Example:
    1. scala> ConfigSource.Environment.read("key").toStringWithValues
      res0: String = ConfigEntry(key, Environment, Left(MissingKey(key, Environment)))

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. val keyType: ConfigKeyType[K]
  13. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. final def suspendF[G[_]](implicit arg0: Sync[G], f: ~>[F, G]): ConfigSource[G, K, V]

    Suspends the reading of this configuration source into context G.

    Suspends the reading of this configuration source into context G.

    G

    the context in which to suspend the reading

    f

    the natural transformation from F to G

    returns

    a new ConfigSource

  17. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  18. def toString(): String
    Definition Classes
    AnyRef → Any
  19. final def transformF[G[_]](implicit arg0: Apply[G], f: ~>[F, G]): ConfigSource[G, K, V]

    Transforms the context F, for the source, to context G.

    Transforms the context F, for the source, to context G.

    G

    the context to which F should be transformed

    f

    the natural transformation from F to G

    returns

    a new ConfigSource

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

Inherited from AnyRef

Inherited from Any

Ungrouped