|
| 1 | + |
| 2 | + |
| 3 | +# econfig - simple Erlang config handler using INI files # |
| 4 | + |
| 5 | +Copyright (c) 2012-2014 Benoît Chesneau. |
| 6 | + |
| 7 | +__Version:__ 0.4.2 |
| 8 | + |
| 9 | +# econfig |
| 10 | + |
| 11 | +econfig is a simple Erlang config handler to manage a config from INI |
| 12 | +files. |
| 13 | + |
| 14 | +econfig can be use to read and update INI files. Values are cached in an |
| 15 | +ETS table and you can manage multiple configuration profiles. A process |
| 16 | +can also subscribe to config updates events. |
| 17 | + |
| 18 | +Autoreload of the config when an INI file is updated is supported, you can even |
| 19 | +manage changes from a full config directory. |
| 20 | + |
| 21 | +See the [NEWS](http://github.com/benoitc/econfig/blob/master/NEWS.md) |
| 22 | +for last changes. |
| 23 | + |
| 24 | +## Examples |
| 25 | + |
| 26 | +Quick usage example: |
| 27 | + |
| 28 | +``` |
| 29 | +1> application:start(gproc). |
| 30 | +ok |
| 31 | +2> application:start(econfig). |
| 32 | +ok |
| 33 | +3> econfig:register_config(couchdb, ["/Users/benoitc/refuge/rcouch/rel/rcouch/etc/default.ini", "/Users/benoitc/refuge/rcouch/rel/rcouch/etc/local.ini"], [autoreload]). |
| 34 | +ok |
| 35 | +4> econfig:subscribe(couchdb). |
| 36 | +true |
| 37 | +5> econfig:get_value(couchdb, "couchdb"). |
| 38 | +[{"delayed_commits","true"}, |
| 39 | + {"file_compression","snappy"}, |
| 40 | + {"os_process_timeout","5000"}, |
| 41 | + {"uri_file","./data/couch.uri"}, |
| 42 | + {"index_dir","./data"}, |
| 43 | + {"max_document_size","4294967296"}, |
| 44 | + {"database_dir","./data"}, |
| 45 | + {"max_dbs_open","100"}] |
| 46 | +6> econfig:set_value(couchdb, "ssl", "test", "1"). |
| 47 | +ok |
| 48 | +7> flush(). |
| 49 | +Shell got {config_updated,couchdb,{set,{"ssl","test"}}} |
| 50 | +ok |
| 51 | +``` |
| 52 | + |
| 53 | +Contribute |
| 54 | +---------- |
| 55 | +For issues, comments or feedback please [create an issue!] [1] |
| 56 | +[1]: http://github.com/benoitc/econfig/issues "econfig issues" |
| 57 | + |
| 58 | + |
| 59 | +## Modules ## |
| 60 | + |
| 61 | + |
| 62 | +<table width="100%" border="0" summary="list of modules"> |
| 63 | +<tr><td><a href="econfig.md" class="module">econfig</a></td></tr> |
| 64 | +<tr><td><a href="econfig_app.md" class="module">econfig_app</a></td></tr> |
| 65 | +<tr><td><a href="econfig_deps.md" class="module">econfig_deps</a></td></tr> |
| 66 | +<tr><td><a href="econfig_file_writer.md" class="module">econfig_file_writer</a></td></tr> |
| 67 | +<tr><td><a href="econfig_server.md" class="module">econfig_server</a></td></tr> |
| 68 | +<tr><td><a href="econfig_sup.md" class="module">econfig_sup</a></td></tr> |
| 69 | +<tr><td><a href="econfig_util.md" class="module">econfig_util</a></td></tr> |
| 70 | +<tr><td><a href="econfig_watcher.md" class="module">econfig_watcher</a></td></tr> |
| 71 | +<tr><td><a href="econfig_watcher_sup.md" class="module">econfig_watcher_sup</a></td></tr></table> |
| 72 | + |
0 commit comments