Documentation ¶
Index ¶
- Constants
- Variables
- func Marshal(v interface{}) (b []byte, err error)
- func NewDecoder(r io.Reader) *objconv.Decoder
- func NewEncoder(w io.Writer) *objconv.Encoder
- 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(n 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(n 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) Reset(w io.Writer)
- type Parser
- func (p *Parser) Buffered() io.Reader
- 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() (objconv.Type, error)
- func (p *Parser) ParseUint() (v uint64, err error)
- func (p *Parser) Reset(r io.Reader)
Constants ¶
View Source
const ( Nil = 0xC0 False = 0xC2 True = 0xC3 Bin8 = 0xC4 Bin16 = 0xC5 Bin32 = 0xC6 Ext8 = 0xC7 Ext16 = 0xC8 Ext32 = 0xC9 Float32 = 0xCA Float64 = 0xCB Uint8 = 0xCC Uint16 = 0xCD Uint32 = 0xCE Uint64 = 0xCF Int8 = 0xD0 Int16 = 0xD1 Int32 = 0xD2 Int64 = 0xD3 Fixext1 = 0xD4 Fixext2 = 0xD5 Fixext4 = 0xD6 Fixext8 = 0xD7 Fixext16 = 0xD8 Str8 = 0xD9 Str16 = 0xDA Str32 = 0xDB Array16 = 0xDC Array32 = 0xDD Map16 = 0xDE Map32 = 0xDF FixmapMask = 0xF0 FixmapTag = 0x80 FixarrayMask = 0xF0 FixarrayTag = 0x90 FixstrMask = 0xE0 FixstrTag = 0xA0 PositiveFixintMask = 0x80 PositiveFixintTag = 0x00 NegativeFixintMask = 0xE0 NegativeFixintTag = 0xE0 ExtTime = int8(-1) )
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 MessagePack format.
Functions ¶
func NewDecoder ¶
NewDecoder returns a new MessagePack decoder that parses values from r.
func NewEncoder ¶
NewEncoder returns a new MessagePack encoder that writes to w.
func NewStreamDecoder ¶
func NewStreamDecoder(r io.Reader) *objconv.StreamDecoder
NewStreamDecoder returns a new MessagePack stream decoder that parses values from r.
func NewStreamEncoder ¶
func NewStreamEncoder(w io.Writer) *objconv.StreamEncoder
NewStreamEncoder returns a new MessagePack stream encoder that writes to w.
Types ¶
type Emitter ¶
type Emitter struct {
// contains filtered or unexported fields
}
Emitter implements a MessagePack 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 ¶
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 ¶
Click to show internal directories.
Click to hide internal directories.