package patoline

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

The Make functor is used for building a specific configuration system for an application. It provides higher-level interfaces to look for the configuration automatically and generating default configuration files.

Parameters

module S : Spec

Signature

include Spec
val name : string

Name of the application.

val spec : (string * Data.t) list

The actual specification of the configuration file. Each field is composed of a name (or key) and a default value.

val path : string * string list

The paths where to look for the configuration file on the file system. The first element corresponds to the main system-wide file, and the list then contains possible locations for files. Configuration files are looked for starting at the end of the list.

val default : Config.t

Default configuration for the system. It is used in case no config file is found in the locations specified in path. It is built directly from spec.

val print_default : Stdlib.out_channel -> unit

Write the default configuration to a channel.

val write_default : string -> unit

Write the default configuration to a file.

val read_config : string -> Config.t

Read a configuration file that should have the same specification as the default module (that is the one defined by spec.

val get_config : unit -> Config.t

Obtain the configuration of the system automatically by looking for configuration files using locations of path. If no configuration file is found, the default configuration is returned.

val print_config : Stdlib.out_channel -> unit

Write the current configuration to a file.

OCaml

Innovation. Community. Security.