Add JSON InputSource to altsrc package

- Implement NewJSONSource* functions for returning an InputSource from
   various JSON data sources.
 - Copy and modify YAML tests for the JSON InputSource

Changes:

* Reverted the method calls and structs to match the v1 interface
This commit is contained in:
John Weldon
2016-07-02 12:35:48 -07:00
committed by Jesse Szwedko
parent 347a9884a8
commit 6a70c4cc92
3 changed files with 535 additions and 3 deletions

View File

@@ -615,9 +615,9 @@ the yaml input source for any flags that are defined on that command. As a note
the "load" flag used would also have to be defined on the command flags in order
for this code snipped to work.
Currently only the aboved specified formats are supported but developers can
add support for other input sources by implementing the
altsrc.InputSourceContext for their given sources.
Currently only YAML and JSON files are supported but developers can add support
for other input sources by implementing the altsrc.InputSourceContext for their
given sources.
Here is a more complete sample of a command using YAML support: