Versions in this module Expand all Collapse all v1 v1.0.0 Aug 7, 2020 Changes in this version + const ServiceError + var Compressors = map[CompressType]Compressor + var ErrMessageTooLong = errors.New("message is too long") + var ErrMetaKVMissing = errors.New("wrong metadata lines. some keys or values are missing") + var ErrUnsupportedCompressor = errors.New("unsupported compressor") + var MaxMessageLength = 0 + func FreeMsg(msg *Message) + func MagicNumber() byte + type CompressType byte + const Gzip + const None + type Compressor interface + Unzip func([]byte) ([]byte, error) + Zip func([]byte) ([]byte, error) + type GzipCompressor struct + func (c GzipCompressor) Unzip(data []byte) ([]byte, error) + func (c GzipCompressor) Zip(data []byte) ([]byte, error) + type Header [12]byte + func (h *Header) SetCompressType(ct CompressType) + func (h *Header) SetHeartbeat(hb bool) + func (h *Header) SetMessageStatusType(mt MessageStatusType) + func (h *Header) SetMessageType(mt MessageType) + func (h *Header) SetOneway(oneway bool) + func (h *Header) SetSeq(seq uint64) + func (h *Header) SetSerializeType(st SerializeType) + func (h *Header) SetVersion(v byte) + func (h Header) CheckMagicNumber() bool + func (h Header) CompressType() CompressType + func (h Header) IsHeartbeat() bool + func (h Header) IsOneway() bool + func (h Header) MessageStatusType() MessageStatusType + func (h Header) MessageType() MessageType + func (h Header) Seq() uint64 + func (h Header) SerializeType() SerializeType + func (h Header) Version() byte + type Message struct + Metadata map[string]string + Payload []byte + ServiceMethod string + ServicePath string + func GetPooledMsg() *Message + func NewMessage() *Message + func Read(r io.Reader) (*Message, error) + func (m *Message) Decode(r io.Reader) error + func (m *Message) Reset() + func (m Message) Clone() *Message + func (m Message) Encode() []byte + func (m Message) WriteTo(w io.Writer) error + type MessageStatusType byte + const Error + const Normal + type MessageType byte + const Request + const Response + type RawDataCompressor struct + func (c RawDataCompressor) Unzip(data []byte) ([]byte, error) + func (c RawDataCompressor) Zip(data []byte) ([]byte, error) + type SerializeType byte + const JSON + const MsgPack + const ProtoBuffer + const SerializeNone + const Thrift