-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSON parsing functions #101
Conversation
Very nice! |
Thanks for the PR, I'm be speaking at events related to OSCON, and I'll get a chance to review this later in the week. |
Awesome! Could we add these to the template functions documentation? |
This is working great for me: core@deis-1 ~ $ cat templates/something.conf.tmpl
BROKER_URL = 'redis://{{ with $obj := JsonUnmarshalObject .deis_locks_cache }}{{ printf "%s:%s" $obj.host $obj.port }}{{ end }}/0'
core@deis-1 ~ $ ./confd -onetime -config-file=/home/core/confd.toml
2014-08-01T04:49:18Z deis-1 ./confd[964]: INFO Target config /home/core/something.conf out of sync
2014-08-01T04:49:18Z deis-1 ./confd[964]: INFO Target config /home/core/something.conf has been updated
core@deis-1 ~ $ cat something.conf
BROKER_URL = 'redis://172.17.8.100:6379/0' |
Ok we have a few of these PRs that add json functions. We should merge them up into a single PR and add them 0.5.x and 0.6.x |
@andymuldowney @carmstrong I'm going to merge #111 once tests pass and update the docs. Closing this out, lets collaborate on #111 for JSON support. |
Could someone add an example to the docs for this? |
) Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.8.1 to 1.9.0. - [Release notes](https://github.com/sirupsen/logrus/releases) - [Changelog](https://github.com/sirupsen/logrus/blob/master/CHANGELOG.md) - [Commits](sirupsen/logrus@v1.8.1...v1.9.0) --- updated-dependencies: - dependency-name: github.com/sirupsen/logrus dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
We use confd with etcd. In etcd, we often store values in JSON. We added two very basic mapped functions to the template parser that allows use to handle JSON values inside of templates - one for objects, and one for arrays.
Usage example: