Emil Hessman
bfbcde0237
decoder: fix format error due to invalid argument (byte to string)
2014-11-02 12:57:26 +01:00
Mitchell Hashimoto
09d7815762
fix a crash if a non-pointer is given to Decode
...
/cc @sethvargo
2014-10-09 20:57:50 -07:00
Mitchell Hashimoto
cd87a48c3c
decode strings to ints
2014-09-30 22:29:21 -07:00
Mitchell Hashimoto
c6802d3070
Actually decode list of objects properly in JSON
2014-08-21 14:02:29 -07:00
Mitchell Hashimoto
65159dc252
Don't double-nest lists of objects
2014-08-21 13:32:31 -07:00
Mitchell Hashimoto
e868ca02fd
Support decoding floats, scientific notation for JSON [GH-5]
2014-08-21 11:22:37 -07:00
Mitchell Hashimoto
b699557f16
Decode into proper arrays of things, add many test cases
...
/cc @armon - This changes how Consul has to define its structure. Ping
me tomorrow to learn more, but going to leave it here for reference too:
The Consul case (there is a test case) never worked even with go-libucl,
because there is an ambiguity of whether you want the inner children or
the array of outer elements (the slice in the Policy struct).
I've added a new modifier you can specify with a tag called "expand"
which will tell hcl to expand the value to its children for decoding.
You can see me use it in the test case which verifies that the Consul
ACLs parse.
2014-08-17 23:50:44 -07:00
Mitchell Hashimoto
21b17881bd
Fix infinite loop in decodeMap
2014-08-11 21:49:12 -07:00
Mitchell Hashimoto
1a9d040ea4
Support Elem on lists
2014-08-11 21:33:44 -07:00
Mitchell Hashimoto
99d585c297
Tests pass.
2014-08-11 20:58:20 -07:00
Mitchell Hashimoto
719a177dba
decoding structs a bit
2014-08-11 16:51:52 -07:00
Mitchell Hashimoto
61e6b8179b
decoding maps works
2014-08-11 16:38:36 -07:00
Mitchell Hashimoto
f340e2e557
compiles, all tests failing
2014-08-11 16:33:28 -07:00
Mitchell Hashimoto
0b07544203
convert types for type aliases
2014-08-08 16:07:08 -07:00
Mitchell Hashimoto
437eb0d851
decode JSON equally
2014-08-08 15:58:34 -07:00
Mitchell Hashimoto
61bd5db85c
Fix consul test case
2014-08-08 15:16:42 -07:00
Mitchell Hashimoto
95d9b2e530
Decoding into a slice with a non-list should make list
2014-08-08 14:59:28 -07:00
Mitchell Hashimoto
bc2f8e57ee
support decoding bools
2014-08-04 22:25:59 -07:00
Mitchell Hashimoto
783acc2aa1
ObjectNodes can only have assignments
2014-08-03 21:56:50 -07:00
Mitchell Hashimoto
a095771be9
case insensitive Get
2014-08-03 17:57:54 -07:00
Mitchell Hashimoto
2e6ea6c71c
decode list of structs
2014-08-03 17:24:37 -07:00
Mitchell Hashimoto
ae8e4f9b5e
Decode into pointers
2014-08-03 17:17:17 -07:00
Mitchell Hashimoto
daed1fd01d
decoder can decode into structures
2014-08-03 14:06:18 -07:00
Mitchell Hashimoto
6462211d14
DecodeAST can take any ast Node
2014-08-03 13:19:20 -07:00
Mitchell Hashimoto
96e92c5213
Decode into flat structures for objects
2014-08-03 13:09:08 -07:00
Mitchell Hashimoto
58215e2ffa
decoder structure for future options
2014-08-02 22:37:58 -07:00
Mitchell Hashimoto
dec60315c8
update decoder to be better interface-aware
2014-08-02 22:12:51 -07:00
Mitchell Hashimoto
c3506acf01
decode more complex structs
2014-08-02 22:05:21 -07:00
Mitchell Hashimoto
8e81ec8b57
Decoder expands exact objects into lists
2014-08-02 21:29:59 -07:00
Mitchell Hashimoto
b2ba9e7b3e
Decode structures
2014-08-02 16:07:54 -07:00
Mitchell Hashimoto
59e0ca9d5a
Start the decoder
2014-08-02 15:44:45 -07:00