Commit Graph

19 Commits

Author SHA1 Message Date
Rafael Weinstein 0555d7a3c1 Remove errors from read/write/encode/decode 2015-08-18 16:37:04 -07:00
Chris Masone 1bd5af910a Add support for int8/uint8
It turns out that having these makes marshaling native go to and from noms
cleaner.

Towards issue #160
2015-08-17 13:44:50 -07:00
Erik Arvidsson ddebdcaefd Slight modification to compound blob encoding
The json serialization now only contains the length of each individual
blob child.

The go representation of this still uses offsets but the offsets are
for the end delimiter.

For "hi" "bye" we get

{"cb", [{"ref": "sha1-hi"}, 2, {"ref": "sha1-bye"}, 3]}

compoundBlob{[2, 5], [sha1-hi, ,sha1-bye]}

Keeping the length in the serialization leads to smaller serializations

Using the end offset leads to simpler binary search and allows us to
use the last entry as the length.

Issue #17
2015-08-07 11:24:27 -04:00
Chris Masone bec1b344be Migrate the types package to JSON decode using the enc package
This change removes the json decoding code from the types package and ports
it onto the enc package's encoding API.

Fixes issue #159
2015-08-06 16:09:35 -07:00
Chris Masone 1a3c3e2c41 Migrate the types package to JSON encode using the enc package
This change removes the json encoding code from the types package and ports
it onto the enc package's encoding API.

Towards issue #159
2015-08-06 10:30:16 -07:00
Chris Masone 7ebe98f49c Address final comments
Primarily removing actual ref caclulations from unit tests, since
those aren't this package's responsiblility
2015-08-05 13:00:49 -07:00
Chris Masone 3c360b7037 Adapt to new compound blob encoding 2015-08-05 11:56:49 -07:00
Chris Masone e562847b5a Address Aaron's comments
1) Clean up unit tests to check against serialization directly
instead of checking refs.
2) Switch argument order of Encode functions to be dst, src
3) Misc other stuff
2015-08-05 11:56:49 -07:00
Chris Masone 7da05a4be7 First cut of Very Low-Level JSON Encoding Package
VLLJEP is go! This first pass handles primitives, strings, refs, lists
and sets of encodeable things, maps of encodeable -> encodeable,
blobs, and compound-blobs. The difference between this and the
encoding stuff in types/ is that it doesn't recurse. The caller is
responsible for going down its value tree until it finds leaves,
encoding them, and then popping back up a level to replace those
values with Refs.

Towards issue #159
2015-08-05 11:56:49 -07:00
Aaron Boodman 2aa809e167 Move enc/* into types/*. 2015-07-09 17:30:43 -07:00
Aaron Boodman b33cab2b34 Rename package 'store' to 'chunks'.
This is in preparation for renaming the 'Commit' abstraction to
DataStore. So we will essentially have a 'chunkstore' abstraction
and a 'datastore' abstraction.
2015-06-16 16:19:16 -07:00
Aaron Boodman 129798c006 Support any type of Value for keys of maps 2015-06-15 15:57:33 -07:00
Aaron Boodman 08a53bb48f add types.Set 2015-06-13 23:25:48 -07:00
Aaron Boodman 1a1832bb35 Add WriteValue and remove support for blobs from top level in json codec 2015-06-10 18:45:54 -07:00
Aaron Boodman c8f9084ade Forgot tests for floats 2015-06-10 06:56:18 -07:00
Aaron Boodman 5884e93e3d Use raw strings instead of normal strings 2015-06-10 06:53:09 -07:00
Aaron Boodman c63c3ee422 Forgot: don't need to test actual contents 2015-06-09 23:34:41 -07:00
Aaron Boodman 7bed29bcde Rest of tests for json_encode.go 2015-06-09 23:32:15 -07:00
Aaron Boodman 554f7b6fed wip: added some testing for json_encode.go 2015-06-09 16:21:37 -07:00