New, untyped, path-based configuration subsystem.
path' ::== \epsilon (* *)
| . <field-name> path' (* field access *)
| [ <index-nr> ] path' (* array index access *)
| [ + ] path' (* cons to array *)
| [ - ] path' (* cons away from array *)
| [ * ] path' (* reset array *)
path ::== path' (* *)
| <field_name> path' (* you can leave out the first dot *)All functions failwith on error. Warnings are generated in verbose mode.
There is a "conf" trace option that traces setting.
exception ConfigError of stringval building_spec : bool Batteries.refmodule type S = sig ... endThe type for gobConfig module.
The implementation of the gobConfig module.
include module type of struct include Impl end
val get_json : string -> Yojson.Safe.tGet JSON value at a given path.
val set_json : string -> Yojson.Safe.t -> unitDirectly set a JSON value; the result must conform to the schema.
val get_conf : unit -> Yojson.Safe.tEquivalent to get_json "".
val set_conf : Yojson.Safe.t -> unitEquivalent to set_conf "".
val get_int : string -> intFunctions to query conf variable of type int.
val set_int : string -> int -> unitFunctions to modify conf variables of type int.
val get_bool : string -> boolFunctions to query conf variable of type bool.
val set_bool : string -> bool -> unitFunctions to modify conf variables of type bool.
val get_string : string -> stringFunctions to query conf variable of type string.
val set_string : string -> string -> unitFunctions to modify conf variables of type string.
val set_auto : string -> string -> unitFunctions to modify conf variables by trying to parse the value. The second argument must be valid Json except single quotes represent double quotes.
val get_list : string -> Yojson.Safe.t listval get_string_list : string -> string listval set_list : string -> Yojson.Safe.t list -> unitval write_file : Fpath.t -> unitWrite the current configuration to filename
val merge_file : Fpath.t -> unitMerge configurations from a file with current.
val merge : Yojson.Safe.t -> unitMerge configurations from a JSON object with current.
val is_immutable : unit -> boolCheck whether modification of configuration is currently allowed.
val with_immutable_conf : (unit -> 'a) -> 'aRun the given computation with modification to configuration disabled.
val earlyglobs : bool Batteries.refAnother hack to see if earlyglobs is enabled