Documentation ¶
Index ¶
- Constants
- Variables
- func PutBuffer(b *Buffer)
- type Buffer
- type BufferDecoder
- func (d *BufferDecoder) Bool() (value bool, err error)
- func (d *BufferDecoder) Bytes(b []byte) (value []byte, err error)
- func (d *BufferDecoder) Error() (value, err error)
- func (d *BufferDecoder) Float32() (value float32, err error)
- func (d *BufferDecoder) Float64() (value float64, err error)
- func (d *BufferDecoder) Int32() (value int32, err error)
- func (d *BufferDecoder) Int64() (value int64, err error)
- func (d *BufferDecoder) Map(keyKind, valueKind Kind) (size uint32, err error)
- func (d *BufferDecoder) Nil() (value bool)
- func (d *BufferDecoder) Slice(kind Kind) (size uint32, err error)
- func (d *BufferDecoder) String() (value string, err error)
- func (d *BufferDecoder) Uint16() (value uint16, err error)
- func (d *BufferDecoder) Uint32() (value uint32, err error)
- func (d *BufferDecoder) Uint64() (value uint64, err error)
- func (d *BufferDecoder) Uint8() (value uint8, err error)
- type BufferEncoder
- func (e *BufferEncoder) Bool(value bool) *BufferEncoder
- func (e *BufferEncoder) Bytes(value []byte) *BufferEncoder
- func (e *BufferEncoder) Error(value error) *BufferEncoder
- func (e *BufferEncoder) Float32(value float32) *BufferEncoder
- func (e *BufferEncoder) Float64(value float64) *BufferEncoder
- func (e *BufferEncoder) Int32(value int32) *BufferEncoder
- func (e *BufferEncoder) Int64(value int64) *BufferEncoder
- func (e *BufferEncoder) Map(size uint32, keyKind, valueKind Kind) *BufferEncoder
- func (e *BufferEncoder) Nil() *BufferEncoder
- func (e *BufferEncoder) Slice(size uint32, kind Kind) *BufferEncoder
- func (e *BufferEncoder) String(value string) *BufferEncoder
- func (e *BufferEncoder) Uint16(value uint16) *BufferEncoder
- func (e *BufferEncoder) Uint32(value uint32) *BufferEncoder
- func (e *BufferEncoder) Uint64(value uint64) *BufferEncoder
- func (e *BufferEncoder) Uint8(value uint8) *BufferEncoder
- type Error
- type Kind
- type Pool
Constants ¶
View Source
const ( VarIntLen16 = 3 VarIntLen32 = 5 VarIntLen64 = 10 )
Variables ¶
View Source
var ( ErrInvalidSlice = errors.New("invalid slice encoding") ErrInvalidMap = errors.New("invalid map encoding") ErrInvalidBytes = errors.New("invalid bytes encoding") ErrInvalidString = errors.New("invalid string encoding") ErrInvalidError = errors.New("invalid error encoding") ErrInvalidBool = errors.New("invalid bool encoding") ErrInvalidUint8 = errors.New("invalid uint8 encoding") ErrInvalidUint16 = errors.New("invalid uint16 encoding") ErrInvalidUint32 = errors.New("invalid uint32 encoding") ErrInvalidUint64 = errors.New("invalid uint64 encoding") ErrInvalidInt32 = errors.New("invalid int32 encoding") ErrInvalidInt64 = errors.New("invalid int64 encoding") ErrInvalidFloat32 = errors.New("invalid float32 encoding") ErrInvalidFloat64 = errors.New("invalid float64 encoding") )
View Source
var ( NilRawKind = byte(0) SliceRawKind = byte(1) MapRawKind = byte(2) AnyRawKind = byte(3) BytesRawKind = byte(4) StringRawKind = byte(5) ErrorRawKind = byte(6) BoolRawKind = byte(7) Uint8RawKind = byte(8) Uint16RawKind = byte(9) Uint32RawKind = byte(10) Uint64RawKind = byte(11) Int32RawKind = byte(12) Int64RawKind = byte(13) Float32RawKind = byte(14) Float64RawKind = byte(15) )
View Source
var ( NilKind = Kind(NilRawKind) SliceKind = Kind(SliceRawKind) MapKind = Kind(MapRawKind) AnyKind = Kind(AnyRawKind) BytesKind = Kind(BytesRawKind) StringKind = Kind(StringRawKind) ErrorKind = Kind(ErrorRawKind) BoolKind = Kind(BoolRawKind) Uint8Kind = Kind(Uint8RawKind) Uint16Kind = Kind(Uint16RawKind) Uint32Kind = Kind(Uint32RawKind) Uint64Kind = Kind(Uint64RawKind) Int32Kind = Kind(Int32RawKind) Int64Kind = Kind(Int64RawKind) Float32Kind = Kind(Float32RawKind) Float64Kind = Kind(Float64RawKind) )
Functions ¶
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
func NewBufferFromBytes ¶ added in v1.2.0
func NewBufferSize ¶ added in v1.2.0
func (*Buffer) MoveOffset ¶ added in v1.2.0
type BufferDecoder ¶ added in v1.2.0
type BufferDecoder []byte
func Decoder ¶
func Decoder(b []byte) *BufferDecoder
func (*BufferDecoder) Bool ¶ added in v1.2.0
func (d *BufferDecoder) Bool() (value bool, err error)
func (*BufferDecoder) Bytes ¶ added in v1.2.0
func (d *BufferDecoder) Bytes(b []byte) (value []byte, err error)
func (*BufferDecoder) Error ¶ added in v1.2.0
func (d *BufferDecoder) Error() (value, err error)
func (*BufferDecoder) Float32 ¶ added in v1.2.0
func (d *BufferDecoder) Float32() (value float32, err error)
func (*BufferDecoder) Float64 ¶ added in v1.2.0
func (d *BufferDecoder) Float64() (value float64, err error)
func (*BufferDecoder) Int32 ¶ added in v1.2.0
func (d *BufferDecoder) Int32() (value int32, err error)
func (*BufferDecoder) Int64 ¶ added in v1.2.0
func (d *BufferDecoder) Int64() (value int64, err error)
func (*BufferDecoder) Map ¶ added in v1.2.0
func (d *BufferDecoder) Map(keyKind, valueKind Kind) (size uint32, err error)
func (*BufferDecoder) Nil ¶ added in v1.2.0
func (d *BufferDecoder) Nil() (value bool)
func (*BufferDecoder) Slice ¶ added in v1.2.0
func (d *BufferDecoder) Slice(kind Kind) (size uint32, err error)
func (*BufferDecoder) String ¶ added in v1.2.0
func (d *BufferDecoder) String() (value string, err error)
func (*BufferDecoder) Uint16 ¶ added in v1.2.0
func (d *BufferDecoder) Uint16() (value uint16, err error)
func (*BufferDecoder) Uint32 ¶ added in v1.2.0
func (d *BufferDecoder) Uint32() (value uint32, err error)
func (*BufferDecoder) Uint64 ¶ added in v1.2.0
func (d *BufferDecoder) Uint64() (value uint64, err error)
func (*BufferDecoder) Uint8 ¶ added in v1.2.0
func (d *BufferDecoder) Uint8() (value uint8, err error)
type BufferEncoder ¶
type BufferEncoder Buffer
func Encoder ¶
func Encoder(b *Buffer) *BufferEncoder
func (*BufferEncoder) Bool ¶
func (e *BufferEncoder) Bool(value bool) *BufferEncoder
func (*BufferEncoder) Bytes ¶
func (e *BufferEncoder) Bytes(value []byte) *BufferEncoder
func (*BufferEncoder) Error ¶
func (e *BufferEncoder) Error(value error) *BufferEncoder
func (*BufferEncoder) Float32 ¶
func (e *BufferEncoder) Float32(value float32) *BufferEncoder
func (*BufferEncoder) Float64 ¶
func (e *BufferEncoder) Float64(value float64) *BufferEncoder
func (*BufferEncoder) Int32 ¶
func (e *BufferEncoder) Int32(value int32) *BufferEncoder
func (*BufferEncoder) Int64 ¶
func (e *BufferEncoder) Int64(value int64) *BufferEncoder
func (*BufferEncoder) Map ¶
func (e *BufferEncoder) Map(size uint32, keyKind, valueKind Kind) *BufferEncoder
func (*BufferEncoder) Nil ¶
func (e *BufferEncoder) Nil() *BufferEncoder
func (*BufferEncoder) Slice ¶
func (e *BufferEncoder) Slice(size uint32, kind Kind) *BufferEncoder
func (*BufferEncoder) String ¶
func (e *BufferEncoder) String(value string) *BufferEncoder
func (*BufferEncoder) Uint16 ¶
func (e *BufferEncoder) Uint16(value uint16) *BufferEncoder
func (*BufferEncoder) Uint32 ¶
func (e *BufferEncoder) Uint32(value uint32) *BufferEncoder
func (*BufferEncoder) Uint64 ¶
func (e *BufferEncoder) Uint64(value uint64) *BufferEncoder
func (*BufferEncoder) Uint8 ¶
func (e *BufferEncoder) Uint8(value uint8) *BufferEncoder
Source Files ¶
Click to show internal directories.
Click to hide internal directories.