codec

package
v0.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPooledBufReader

func GetPooledBufReader(r io.Reader) *bufio.Reader

func GetPooledMsgPackDecoder

func GetPooledMsgPackDecoder(r io.Reader) *msgpack.Decoder

func GetPooledMsgPackEncoder

func GetPooledMsgPackEncoder(w io.Writer) *msgpack.Encoder

func ReleasePooledBufReader

func ReleasePooledBufReader(v *bufio.Reader)

func ReleasePooledMsgPackConn

func ReleasePooledMsgPackConn(v MsgPackConn)

func ReleasePooledMsgPackDecoder

func ReleasePooledMsgPackDecoder(v *msgpack.Decoder)

func ReleasePooledMsgPackEncoder

func ReleasePooledMsgPackEncoder(v *msgpack.Encoder)

Types

type MsgPackConn

type MsgPackConn interface {
	gonet.Conn
	MsgPackEncoder
	MsgPackDecoder
}

func GetPooledMsgPackConn

func GetPooledMsgPackConn(conn gonet.Conn) MsgPackConn

type MsgPackCustomDecoder

type MsgPackCustomDecoder interface {
	DecodeMsgPack(dec MsgPackDecoder) error
}

type MsgPackCustomEncoder

type MsgPackCustomEncoder interface {
	EncodeMsgPack(enc MsgPackEncoder) error
}

type MsgPackDecoder

type MsgPackDecoder interface {
	Buffered() io.Reader
	Decode(v any) error
	DecodeMulti(v ...any) error
	DecodeValue(v reflect.Value) error
	DecodeNil() error
	DecodeBool() (bool, error)
	DecodeDuration() (time.Duration, error)
	DecodeInterface() (any, error)
	DecodeInterfaceLoose() (any, error)
	DecodeRaw() (msgpack.RawMessage, error)
	DecodeMapLen() (int, error)
	DecodeMap() (map[string]any, error)
	DecodeUntypedMap() (map[any]any, error)
	DecodeTypedMap() (any, error)
	DecodeFloat32() (float32, error)
	DecodeFloat64() (float64, error)
	DecodeUint() (uint, error)
	DecodeUint8() (uint8, error)
	DecodeUint16() (uint16, error)
	DecodeUint32() (uint32, error)
	DecodeUint64() (uint64, error)
	DecodeInt() (int, error)
	DecodeInt8() (int8, error)
	DecodeInt16() (int16, error)
	DecodeInt32() (int32, error)
	DecodeInt64() (int64, error)
	Query(query string) ([]any, error)
	DecodeArrayLen() (int, error)
	DecodeSlice() ([]any, error)
	DecodeBytes() ([]byte, error)
	DecodeString() (string, error)
}

type MsgPackEncoder

type MsgPackEncoder interface {
	Writer() io.Writer
	Encode(v any) error
	EncodeMulti(v ...any) error
	EncodeValue(v reflect.Value) error
	EncodeNil() error
	EncodeBool(value bool) error
	EncodeDuration(d time.Duration) error
	EncodeMap(m map[string]any) error
	EncodeMapSorted(m map[string]any) error
	EncodeMapLen(l int) error
	EncodeUint8(n uint8) error
	EncodeUint16(n uint16) error
	EncodeUint32(n uint32) error
	EncodeUint64(n uint64) error
	EncodeInt8(n int8) error
	EncodeInt16(n int16) error
	EncodeInt32(n int32) error
	EncodeInt64(n int64) error
	EncodeUint(n uint64) error
	EncodeInt(n int64) error
	EncodeFloat32(n float32) error
	EncodeFloat64(n float64) error
	EncodeBytesLen(l int) error
	EncodeString(v string) error
	EncodeBytes(v []byte) error
	EncodeArrayLen(l int) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL