https://github.com/dnephin/configtf
Config deserialization library for golang
https://github.com/dnephin/configtf
Last synced: about 2 months ago
JSON representation
Config deserialization library for golang
- Host: GitHub
- URL: https://github.com/dnephin/configtf
- Owner: dnephin
- Created: 2016-09-29T21:18:57.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-20T06:01:22.000Z (over 8 years ago)
- Last Synced: 2025-01-26T00:14:42.129Z (3 months ago)
- Language: Go
- Homepage:
- Size: 9.77 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
Config Transform
================Config Transform is a library for deserializing configuration files from a
``map[string]interface{}`` to a struct type. It is commonly used with JSON and
YAML configuration files.Features include:
* generate documentation from comments on the ``struct``
* custom deserialization of user defined types
* useful error messages when transformation fails
* additional user-defined field validation.. image:: https://godoc.org/github.com/dnephin/configtf?status.svg
:target: http://godoc.org/github.com/dnephin/configtf.. image:: https://circleci.com/gh/dnephin/configtf/tree/master.svg?style=shield
:target: https://circleci.com/gh/dnephin/configtf/tree/masterWhy configtf?
-------------Both ``encoding/json`` and ``go-yaml`` provide functions for deserializing from
a config file, but each have their significant shortcomings:* the error messages returned by ``encoding/json`` do not include enough
information to actually find and fix the error
* ``go-yaml`` does not support polymorphic types
* supporting multiple config formats (json, yaml, ini, toml, etc) requires that
you annotate your structs for each format
* no support for generated documentation
* no user-defined type validation