Config-Processor
view release on metacpan or search on metacpan
metrics: { include: metrics/* }
- underlay
Merges specified configuration parameters with parameters located at the same
context. Configuration parameters from the context overrides parameters from
the directive. `underlay` directive most usefull in combination with `var`
and `include` directives.
For example, you can use this directive to set default values of parameters.
myapp:
db:
connectors:
default:
port: "1234"
dbname: "stat"
options:
PrintWarn: 0
PrintError: 0
RaiseError: 1
stat_master:
underlay: { var: .default }
host: "stat-master.mydb.com"
username: "stat_writer"
password: "stat_writer_pass"
stat_slave:
underlay: { var: .default }
host: "stat-slave.mydb.com"
username: "stat_reader"
password: "stat_reader_pass"
You can move default parameters in separate files.
myapp:
db:
connectors:
underlay:
- { include: db_connectors/default.yml }
- { include: db_connectors/default_test.yml }
stat_master:
underlay: { var: .default }
host: "stat-master.mydb.com"
username: "stat_writer"
password: "stat_writer_pass"
stat_slave:
underlay: { var: .default }
host: "stat-slave.mydb.com"
username: "stat_reader"
password: "stat_reader_pass"
test:
underlay: { var: .default_test }
username: "test"
password: "test_pass"
- overlay
Merges specified configuration parameters with parameters located at the same
context. Configuration parameters from the directive overrides parameters from
the context. `overlay` directive most usefull in combination with `var` and
`include` directives.
For example, you can use `overlay` directive to temporaly overriding regular
configuration parameters.
myapp:
db:
connectors:
default:
port: "1234"
dbname: "stat"
options:
PrintWarn: 0
PrintError: 0
RaiseError: 1
test:
host: "localhost"
port: "4321"
stat_master:
underlay: { var: .default }
host: "stat-master.mydb.com"
username: "stat_writer"
password: "stat_writer_pass"
overlay: { var: .test }
stat_slave:
underlay: { var: .default }
host: "stat-slave.mydb.com"
username: "stat_reader"
password: "stat_reader_pass"
overlay: { var: .test }
To disable overriding just assign to `test` connector empty hash.
test: {}
# AUTHOR
Eugene Ponizovsky, <ponizovsky@gmail.com>
# COPYRIGHT AND LICENSE
Copyright (c) 2016-2018, Eugene Ponizovsky, <ponizovsky@gmail.com>.
All rights reserved.
This module is free software; you can redistribute it and/or modify it under
the same terms as Perl itself.
( run in 0.798 second using v1.01-cache-2.11-cpan-df04353d9ac )