1
0
mirror of https://github.com/json-iterator/go.git synced 2025-06-30 23:23:49 +02:00

expose OptionalEncoder&OptionalDecoder; add attachment to Stream&Iterator for customized decoder/encoder

This commit is contained in:
Tao Wen
2017-11-08 11:41:45 +08:00
parent aed5a81f09
commit b1b003864e
8 changed files with 38 additions and 34 deletions

View File

@ -4,15 +4,16 @@ import (
"io"
)
// Stream is a io.Writer like object, with JSON specific write functions.
// stream is a io.Writer like object, with JSON specific write functions.
// Error is not returned as return value, but stored as Error member on this stream instance.
type Stream struct {
cfg *frozenConfig
out io.Writer
buf []byte
n int
Error error
indention int
cfg *frozenConfig
out io.Writer
buf []byte
n int
Error error
indention int
Attachment interface{} // open for customized encoder
}
// NewStream create new stream instance.