Skip to content

processone/yconf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

9682a60 · Feb 13, 2025
Dec 5, 2024
Feb 13, 2025
Feb 13, 2025
Jun 30, 2021
Dec 18, 2024
May 3, 2019
Jun 20, 2021
Jun 20, 2021
May 3, 2019
Feb 13, 2025
Feb 13, 2025

Repository files navigation

YAML configuration processor

CI Coverage Status Hex version

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}]}]}

About

YAML configuration processor

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 6