Streaming json parser implementation
I am not sure where i left this two years ago...
Once you create the decoder, you can iterate over the tokens:
r := strings.NewReader(`{"hello":"world"}`)
dec := sjson.NewDecoder(r)
for t, err := dec.Next(); err != nil && t != nil; t, err = dec.Next() {
// iterate over every token
}
-
Simple Tokens:
- NumberType
- StringType
- BoolType
- NullType
-
Complex Tokens:
- ObjectType
- ArrayType
-
Special Tokens
- MemberType
- EndType
NOTE: whitespace is currently ignored