Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // MissingBinaryEncodingVersion indicate that the encoding version is missing MissingBinaryEncodingVersion = &shared.BadRequestError{Message: "Missing binary encoding version."} // InvalidBinaryEncodingVersion indicate that the encoding version is incorrect InvalidBinaryEncodingVersion = &shared.BadRequestError{Message: "Invalid binary encoding version."} // MsgPayloadNotThriftEncoded indicate message is not thrift encoded MsgPayloadNotThriftEncoded = &shared.BadRequestError{Message: "Message payload is not thrift encoded."} )
Functions ¶
This section is empty.
Types ¶
type BinaryEncoder ¶
type BinaryEncoder interface { Encode(obj ThriftObject) ([]byte, error) Decode(payload []byte, val ThriftObject) error }
BinaryEncoder represent the encoder which can serialize or deserialize object
type ThriftObject ¶
ThriftObject represents a thrift object
type ThriftRWEncoder ¶
type ThriftRWEncoder struct { }
ThriftRWEncoder is an implementation using thrift rw for binary encoding / decoding NOTE: this encoder only works for thrift struct
func NewThriftRWEncoder ¶
func NewThriftRWEncoder() *ThriftRWEncoder
NewThriftRWEncoder generate a new ThriftRWEncoder
func (*ThriftRWEncoder) Decode ¶
func (t *ThriftRWEncoder) Decode(binary []byte, val ThriftObject) error
Decode decode the object
func (*ThriftRWEncoder) Encode ¶
func (t *ThriftRWEncoder) Encode(obj ThriftObject) ([]byte, error)
Encode encode the object
Click to show internal directories.
Click to hide internal directories.