https://github.com/processone/yconf
YAML configuration processor
https://github.com/processone/yconf
Last synced: 8 months ago
JSON representation
YAML configuration processor
- Host: GitHub
- URL: https://github.com/processone/yconf
- Owner: processone
- License: apache-2.0
- Created: 2019-05-03T07:34:36.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2025-03-27T14:02:49.000Z (11 months ago)
- Last Synced: 2025-03-27T15:23:01.423Z (11 months ago)
- Language: Erlang
- Size: 329 KB
- Stars: 8
- Watchers: 11
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# YAML configuration processor
[](https://github.com/processone/yconf/actions/workflows/ci.yml)
[](https://coveralls.io/github/processone/yconf?branch=master)
[](https://hex.pm/packages/yconf)
You can find usage example in ejabberd. See `econf.erl` and `ejabberd_options.erl` for most parts that are using it.
Validation is performed based on rules that you pass to `yconf:parser/2`, there is no way to load those rules from
some special syntax file. Generally you will do something like this:
```
yconf:parse("/home/me/conf.yml", #{
host => yconf:string(),
opts => yconf:options(#{
addr => yconf:ip(),
count => yconf:non_neg_int()
}
)}).
```
That when feed with:
```
host: "test.com"
opts:
addr: "127.0.0.1"
count: 100
```
should produce:
```
{ok,[{host,"test.com"},{opts,[{addr,{127,0,0,1}},{count,100}]}]}
```