Documentation ¶
Index ¶
- Variables
- func Marshal(v interface{}) (b []byte, err error)
- func NewDecoder(r io.Reader) *objconv.Decoder
- func NewEncoder(w io.Writer) *objconv.Encoder
- func NewPrettyEncoder(w io.Writer) *objconv.Encoder
- func NewPrettyStreamEncoder(w io.Writer) *objconv.StreamEncoder
- func NewStreamDecoder(r io.Reader) *objconv.StreamDecoder
- func NewStreamEncoder(w io.Writer) *objconv.StreamEncoder
- func Unmarshal(b []byte, v interface{}) error
- type Emitter
- func (e *Emitter) EmitArrayBegin(_ int) (err error)
- func (e *Emitter) EmitArrayEnd() (err error)
- func (e *Emitter) EmitArrayNext() (err error)
- func (e *Emitter) EmitBool(v bool) (err error)
- func (e *Emitter) EmitBytes(v []byte) (err error)
- func (e *Emitter) EmitDuration(v time.Duration) (err error)
- func (e *Emitter) EmitError(v error) (err error)
- func (e *Emitter) EmitFloat(v float64, bitSize int) (err error)
- func (e *Emitter) EmitInt(v int64, _ int) (err error)
- func (e *Emitter) EmitMapBegin(_ int) (err error)
- func (e *Emitter) EmitMapEnd() (err error)
- func (e *Emitter) EmitMapNext() (err error)
- func (e *Emitter) EmitMapValue() (err error)
- func (e *Emitter) EmitNil() (err error)
- func (e *Emitter) EmitString(v string) (err error)
- func (e *Emitter) EmitTime(v time.Time) (err error)
- func (e *Emitter) EmitUint(v uint64, _ int) (err error)
- func (e *Emitter) PrettyEmitter() objconv.Emitter
- func (e *Emitter) Reset(w io.Writer)
- type Parser
- func (p *Parser) Buffered() io.Reader
- func (p *Parser) DecodeBytes(b []byte) (v []byte, err error)
- func (p *Parser) ParseArrayBegin() (n int, err error)
- func (p *Parser) ParseArrayEnd(n int) (err error)
- func (p *Parser) ParseArrayNext(n int) (err error)
- func (p *Parser) ParseBool() (v bool, err error)
- func (p *Parser) ParseBytes() (v []byte, err error)
- func (p *Parser) ParseDuration() (v time.Duration, err error)
- func (p *Parser) ParseError() (v error, err error)
- func (p *Parser) ParseFloat() (v float64, err error)
- func (p *Parser) ParseInt() (v int64, err error)
- func (p *Parser) ParseMapBegin() (n int, err error)
- func (p *Parser) ParseMapEnd(n int) (err error)
- func (p *Parser) ParseMapNext(n int) (err error)
- func (p *Parser) ParseMapValue(n int) (err error)
- func (p *Parser) ParseNil() (err error)
- func (p *Parser) ParseString() (v []byte, err error)
- func (p *Parser) ParseTime() (v time.Time, err error)
- func (p *Parser) ParseType() (t objconv.Type, err error)
- func (p *Parser) ParseUint() (v uint64, err error)
- func (p *Parser) Reset(r io.Reader)
- type PrettyEmitter
- func (e *PrettyEmitter) EmitArrayBegin(n int) (err error)
- func (e *PrettyEmitter) EmitArrayEnd() (err error)
- func (e *PrettyEmitter) EmitArrayNext() (err error)
- func (e *PrettyEmitter) EmitMapBegin(n int) (err error)
- func (e *PrettyEmitter) EmitMapEnd() (err error)
- func (e *PrettyEmitter) EmitMapNext() (err error)
- func (e *PrettyEmitter) EmitMapValue() (err error)
- func (e *PrettyEmitter) Reset(w io.Writer)
Constants ¶
This section is empty.
Variables ¶
View Source
var Codec = objconv.Codec{ NewEmitter: func(w io.Writer) objconv.Emitter { return NewEmitter(w) }, NewParser: func(r io.Reader) objconv.Parser { return NewParser(r) }, }
Codec for the JSON format.
View Source
var PrettyCodec = objconv.Codec{ NewEmitter: func(w io.Writer) objconv.Emitter { return NewPrettyEmitter(w) }, NewParser: func(r io.Reader) objconv.Parser { return NewParser(r) }, }
PrettyCodec for the JSON format.
Functions ¶
func NewDecoder ¶
NewDecoder returns a new JSON decoder that parses values from r.
func NewEncoder ¶
NewEncoder returns a new JSON encoder that writes to w.
func NewPrettyEncoder ¶
NewPrettyEncoder returns a new JSON encoder that writes to w.
func NewPrettyStreamEncoder ¶
func NewPrettyStreamEncoder(w io.Writer) *objconv.StreamEncoder
NewPrettyStreamEncoder returns a new JSON stream encoder that writes to w.
func NewStreamDecoder ¶
func NewStreamDecoder(r io.Reader) *objconv.StreamDecoder
NewStreamDecoder returns a new JSON stream decoder that parses values from r.
func NewStreamEncoder ¶
func NewStreamEncoder(w io.Writer) *objconv.StreamEncoder
NewStreamEncoder returns a new JSON stream encoder that writes to w.
Types ¶
type Emitter ¶
type Emitter struct {
// contains filtered or unexported fields
}
Emitter implements a JSON emitter that satisfies the objconv.Emitter interface.
func NewEmitter ¶
func (*Emitter) EmitArrayBegin ¶
func (*Emitter) EmitArrayEnd ¶
func (*Emitter) EmitArrayNext ¶
func (*Emitter) EmitMapBegin ¶
func (*Emitter) EmitMapEnd ¶
func (*Emitter) EmitMapNext ¶
func (*Emitter) EmitMapValue ¶
func (*Emitter) EmitString ¶
func (*Emitter) PrettyEmitter ¶
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func (*Parser) ParseArrayBegin ¶
func (*Parser) ParseArrayEnd ¶
func (*Parser) ParseArrayNext ¶
func (*Parser) ParseBytes ¶
func (*Parser) ParseError ¶
func (*Parser) ParseFloat ¶
func (*Parser) ParseMapBegin ¶
func (*Parser) ParseMapEnd ¶
func (*Parser) ParseMapNext ¶
func (*Parser) ParseMapValue ¶
func (*Parser) ParseString ¶
type PrettyEmitter ¶
type PrettyEmitter struct { Emitter // contains filtered or unexported fields }
func NewPrettyEmitter ¶
func NewPrettyEmitter(w io.Writer) *PrettyEmitter
func (*PrettyEmitter) EmitArrayBegin ¶
func (e *PrettyEmitter) EmitArrayBegin(n int) (err error)
func (*PrettyEmitter) EmitArrayEnd ¶
func (e *PrettyEmitter) EmitArrayEnd() (err error)
func (*PrettyEmitter) EmitArrayNext ¶
func (e *PrettyEmitter) EmitArrayNext() (err error)
func (*PrettyEmitter) EmitMapBegin ¶
func (e *PrettyEmitter) EmitMapBegin(n int) (err error)
func (*PrettyEmitter) EmitMapEnd ¶
func (e *PrettyEmitter) EmitMapEnd() (err error)
func (*PrettyEmitter) EmitMapNext ¶
func (e *PrettyEmitter) EmitMapNext() (err error)
func (*PrettyEmitter) EmitMapValue ¶
func (e *PrettyEmitter) EmitMapValue() (err error)
func (*PrettyEmitter) Reset ¶
func (e *PrettyEmitter) Reset(w io.Writer)
Click to show internal directories.
Click to hide internal directories.