gojay icon indicating copy to clipboard operation
gojay copied to clipboard

More compataibility with encoding/json

Open freman opened this issue 7 years ago • 1 comments

It'd be sweet to be more compatible with the encoding/json Decode interface

Specifically functions like

func (dec *Decoder) More() bool
func (dec *Decoder) Token() (Token, error)

Seem to be missing with no equivilent.

Useful for parsing giant streaming files (of a single object) and splitting them into multiple objects - or extracting an array.

eg: https://ip-ranges.amazonaws.com/ip-ranges.json

Would be parsed by skipping through tokens until we got to the prefixes array, then parsed as a stream of objects until done

freman avatar Jul 13 '18 15:07 freman

Hi,

Sure, I agree it would be a good idea. I'm ok for pull requests if you want to contribute. Otherwise I'll try to find time to do it.

Let me know if you want to add these or if I should do it. Thanks

francoispqt avatar Jul 14 '18 16:07 francoispqt