Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
Decoder wraps an io.Reader to provide incremental decoding of JSON values
func NewDecoder ¶
NewDecoder creates new Decoder to read JSON values at the provided emitDepth from the provider io.Reader. If emitDepth is < 0, values at every depth will be emitted.
func (*Decoder) EmitKV ¶
EmitKV enables emitting a jstream.KV struct when the items(s) parsed at configured emit depth are within a JSON object. By default, only the object values are emitted.
func (*Decoder) ObjectAsKVS ¶
ObjectAsKVS - by default JSON returns map[string]interface{} this is usually fine in most cases, but when you need to preserve the input order its not a right data structure. To preserve input order please use this option.
type KV ¶
type KV struct { Key string `json:"key"` Value interface{} `json:"value"` }
KV contains a key and value pair parsed from a decoded object
type KVS ¶
type KVS []KV
KVS - represents key values in an JSON object
func (KVS) MarshalJSON ¶
MarshalJSON - implements converting a KVS datastructure into a JSON object with multiple keys and values.