Packages

p

laika

config

package config

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. All

Type Members

  1. case class ASTValue(value: Element) extends ConfigValue with Product with Serializable

    A value containing an AST element obtained from text markup or templates.

    A value containing an AST element obtained from text markup or templates.

    Such a value can be used in scenarios where substitution variables in templates or markup want to refer to other AST elements and include them into their AST tree as is.

  2. case class ArrayValue(values: Seq[ConfigValue]) extends ConfigValue with Product with Serializable
  3. case class BooleanValue(value: Boolean) extends SimpleConfigValue with Product with Serializable
  4. trait Config extends AnyRef

    API for retrieving configuration values based on a string key and a decoder.

    API for retrieving configuration values based on a string key and a decoder.

    Config instances are used in many places in this library, each Document, DocumentTree and Directive has a Config instance associated with it.

    One use case for configuration is controlling the behaviour of built-in features, like setting the navigation order or the depth for table of contents.

    A second use case is user configuration, where custom variables can be set in configuration files or headers and then referenced in templates or markup with the syntax ${ref.path}.

    The key is a path separated by '.', which allows to reference nested objects in the configuration.

    Built-in decoders are available for simple types like String, Int, Double, Boolean and any Seq consisting of those values.

    It also comes with a decoder for Path, which resolves relative paths in the configuration against the (virtual) path of the origin.

    This API is usually used with values obtained by parsing HOCON, as specified in https://github.com/lightbend/config/blob/master/HOCON.md, but the API is generic and can also be used with values specified programmatically.

    Please note that Laika does not depend on the Typesafe Config library or any of its commonly used Scala wrappers or forks. It has its own HOCON parser, which implements the full spec while still being minimal and lightweight. It also ensures the FP properties are kept intact, e.g. it has full referential transparency and does not throw Exceptions like most of the alternatives.

  5. class ConfigBuilder extends AnyRef

    A builder for creating a Config instance programmatically.

    A builder for creating a Config instance programmatically.

    While it's most common in Laika that Config instances are obtained by parsing HOCON, instances can also be created entirely programmatically, or by a combination of HOCON and programmatic values if an existing fallback is used with builder.

  6. trait ConfigDecoder[T] extends AnyRef

    A type class that can decode a ConfigValue to an instance of T.

  7. trait ConfigEncoder[-T] extends AnyRef

    A type class that can encode a value of type T as a ConfigValue.

  8. sealed trait ConfigError extends AnyRef

    Base trait for all configuration errors that occurred during parsing, resolving, retrieving or convering configuration values.

  9. case class ConfigErrors(failures: NonEmptyChain[ConfigError]) extends ConfigError with Product with Serializable

    Multiple errors that occurred when processing configuration.

  10. case class ConfigException(error: ConfigError) extends RuntimeException with Product with Serializable

    A ConfigError as a RuntimeException for use cases where a Throwable is required.

  11. trait ConfigParser extends AnyRef

    A parser for obtaining a Config instance from a HOCON string.

    A parser for obtaining a Config instance from a HOCON string.

    The HOCON format expected by this parsers is specified at https://github.com/lightbend/config/blob/master/HOCON.md

  12. case class ConfigParserError(failure: Failure) extends ConfigError with Product with Serializable

    An error that occurred when parsing HOCON input.

  13. case class ConfigParserErrors(failures: Seq[Failure]) extends ConfigError with Product with Serializable

    Multiple errors that occurred when parsing HOCON input.

  14. case class ConfigResolverError(message: String) extends ConfigError with Product with Serializable

    An error that occurred when resolving the interim result of a parsing operation.

  15. case class ConfigResourceError(message: String) extends ConfigError with Product with Serializable

    An error that occurred when loading a resource, before parsing could start.

  16. sealed trait ConfigValue extends Product with Serializable

    The base trait for all configuration values.

    The base trait for all configuration values.

    This data structure is quite similar to those found in common JSON libraries (HOCON is a JSON superset after all).

    The only exception is one special type: the ASTValue which can hold an instance of a document AST obtained from parsing text markup.

    This can be useful in scenarios where substitution variables in templates or markup want to refer to other AST elements and include them into their AST tree as is.

  17. case class DecodingError(error: String, key: Option[Key] = None) extends ConfigError with Product with Serializable

    An error that occurred when decoding a configuration value to a target type.

  18. trait DefaultKey[T] extends AnyRef

    A defaultKey can be used for commonly used configuration objects like AutonumberConfig that are expected to be mapped to a specific key, like autonumbering without requiring the user to remember these keys.

    A defaultKey can be used for commonly used configuration objects like AutonumberConfig that are expected to be mapped to a specific key, like autonumbering without requiring the user to remember these keys.

    val config: Config = ???
    val res: ConfigResult[AutonumberConfig] = config.get[AutonumberConfig]

    In the example above retrieval happens solely based on the type of the result with the associated key being specified by an implicit DefaultKey.

  19. case class DocumentConfigErrors(path: Path, failures: NonEmptyChain[ConfigError]) extends ConfigError with Product with Serializable

    Multiple errors that occurred when processing configuration for a document.

  20. case class DoubleValue(value: Double) extends SimpleConfigValue with Product with Serializable
  21. case class Field(key: String, value: ConfigValue, origin: Origin = Origin.root) extends Product with Serializable

    A single field of an object value.

  22. case class InvalidType(expected: String, actual: ConfigValue) extends ConfigError with Product with Serializable

    Indicates that a value found in the configuration does not have the expected type so that type conversion is not even attempted.

  23. case class Key(segments: Seq[String]) extends Product with Serializable

  24. case class LongValue(value: Long) extends SimpleConfigValue with Product with Serializable
  25. case class NotFound(key: Key) extends ConfigError with Product with Serializable

    A required value that could not be found.

  26. class ObjectConfig extends Config

    The default implementation of the Config API.

  27. case class ObjectValue(values: Seq[Field]) extends ConfigValue with Product with Serializable
  28. case class Origin(scope: Scope, path: Path, sourcePath: Option[String] = None) extends Product with Serializable

    The origin of a configuration value.

    The origin of a configuration value.

    Origins can be used to distinguish values from a specific Config instance from those which were inherited from a fallback, which might be relevant in scenarios where relative paths need to be resolved.

    scope

    the scope of the containing config instance

    path

    the virtual path of containing config instance in a document tree (not the key inside the configuration)

    sourcePath

    the path in the file system this configuration originates from, empty if it was constructed in memory

  29. sealed trait SimpleConfigValue extends ConfigValue

    Base trait for all simple configuration values.

  30. case class StringValue(value: String) extends SimpleConfigValue with Product with Serializable
  31. case class Traced[T](value: T, origin: Origin) extends Product with Serializable

    A value tagged with its origin.

  32. case class TreeConfigErrors(failures: NonEmptyChain[DocumentConfigErrors]) extends ConfigError with Product with Serializable

    Multiple errors that occurred when processing configuration for a document tree.

  33. case class ValidationError(message: String) extends ConfigError with Product with Serializable

    A generic error for invalid values.

Value Members

  1. object Config
  2. object ConfigBuilder

    Companion factory for ConfigBuilder instances.

  3. object ConfigDecoder

    Companion containing default decoder implementations for simple values and Seq's.

  4. object ConfigEncoder

    Companion containing default encoder implementations for simple values and Seq's.

  5. object ConfigParser
  6. object DefaultKey
  7. object DocumentConfigErrors extends Serializable
  8. object EmptyConfig extends Config

    An empty configuration instance.

  9. object Key extends Serializable
  10. object LaikaKeys

    Constants for configuration keys for the library's core configuration entries.

  11. object NullValue extends SimpleConfigValue with Product with Serializable
  12. object Origin extends Serializable

Ungrouped