package env_config

  1. Overview
  2. Docs
include Async
type t
include S with type t := t
val default_path : unit -> string Async.Deferred.t

The default configuration

val load_from_disk : path:string -> t Async.Deferred.t

How to load a configuration from disk. This will be used in conjunction with default_path if no override is provided.

include Overridable with type t := t
include S with type t := t
val t_of_sexp : Sexplib0.Sexp.t -> t
val environment_variable : string

The environment variable used to retrieve configuration overrides

val documentation : string

What to display when the environment variable is malformed, in addition to some helpful information

val allow_extra_fields : bool

Allow extra fields to be present in the configuration sexp deserializer. Most users will want this to be true, as it is unlikely the configuration will always be the same type, and most types are not versioned.

module Environment_override : sig ... end

A mechanism for instructing a different configuration than the default be loaded by providing a different environment value than a t.

val from_override : default_config:t Core.Or_error.t -> Environment_override.t -> t

The environment requested that the config be determined by Environment_override. The default is provided to this function.