| |
| |
| |
|
|
| |
|
|
| package jsontext |
|
|
| import ( |
| "io" |
|
|
| "encoding/json/internal" |
| ) |
|
|
| |
| |
| var Internal exporter |
|
|
| type exporter struct{} |
|
|
| |
| |
| |
| func (exporter) Export(p *internal.NotForPublicUse) export { |
| if p != &internal.AllowInternalUse { |
| panic("unauthorized call to Export") |
| } |
| return export{} |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
| type export struct{} |
|
|
| |
| func (export) Encoder(e *Encoder) *encoderState { return &e.s } |
|
|
| |
| func (export) Decoder(d *Decoder) *decoderState { return &d.s } |
|
|
| func (export) GetBufferedEncoder(o ...Options) *Encoder { |
| return getBufferedEncoder(o...) |
| } |
| func (export) PutBufferedEncoder(e *Encoder) { |
| putBufferedEncoder(e) |
| } |
|
|
| func (export) GetStreamingEncoder(w io.Writer, o ...Options) *Encoder { |
| return getStreamingEncoder(w, o...) |
| } |
| func (export) PutStreamingEncoder(e *Encoder) { |
| putStreamingEncoder(e) |
| } |
|
|
| func (export) GetBufferedDecoder(b []byte, o ...Options) *Decoder { |
| return getBufferedDecoder(b, o...) |
| } |
| func (export) PutBufferedDecoder(d *Decoder) { |
| putBufferedDecoder(d) |
| } |
|
|
| func (export) GetStreamingDecoder(r io.Reader, o ...Options) *Decoder { |
| return getStreamingDecoder(r, o...) |
| } |
| func (export) PutStreamingDecoder(d *Decoder) { |
| putStreamingDecoder(d) |
| } |
|
|
| func (export) IsIOError(err error) bool { |
| _, ok := err.(*ioError) |
| return ok |
| } |
|
|