cortoproject / corto

A hierarchical object store for connecting realtime machine data with web applications, historians & more
https://www.corto.io
MIT License
87 stars 14 forks source link

Allow automatic loading of configuration files and paths #622

Closed SanderMertens closed 6 years ago

SanderMertens commented 7 years ago

To ensure that application code does not become polluted with code that loads configuration, a mechanism is needed that can specify and import a configuration.

A simple mechanism would be to have an environment variable CORTO_CONFIG that can point to either a file or a directory. If it points to a file, then that file will be loaded with corto_load- this means that the file extension must be available in driver/ext. If it points to a directory, corto will load all files in that directory.

If the environment variable is not set, no configuration is loaded.

To make it easier to specify a configuration, the tool should have an option --config that allows specifying a value for $CORTO_CONFIG.