func DeserializeThrift(msg thrift.TStruct, buf []byte) (remain uint64, err error)
DeserializeThrift deserializes the bytes in buf into the given thrift msg type returns the number of remaining bytes in the buffer that weren't needed for deserialization and any error if there was one, or nil.
func DeserializeThriftStream(msg thrift.TStruct, r io.Reader) error
DeserializeThriftStream populates the given msg by reading from the provided stream until it completes the deserialization.
func SerializeThriftStream(msg thrift.TStruct, w io.Writer) error
SerializeThriftStream writes out the serialized bytes of the passed in type to the given writer stream.
Serializer is an object that can stick around to provide convenience functions and allow object reuse
type Serializer struct { thrift.TSerializer }
func NewThriftSerializer() *Serializer
NewThriftSerializer constructs a serializer with a default buffer of 1024
func (t *Serializer) Serialize(msg thrift.TStruct, w io.Writer, enc encryption.Encryptor) (int, error)
Serialize will serialize the given msg to the writer stream w, optionally encrypting it on the way if enc is not nil, returning the total number of bytes written and any error received, or nil