Documentation ¶
Overview ¶
Package thrift is just some useful helpers for interacting with thrift to make other code easier to read/write and centralize interactions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeserializeThrift ¶
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 ¶
DeserializeThriftStream populates the given msg by reading from the provided stream until it completes the deserialization.
Types ¶
type Serializer ¶
type Serializer struct {
thrift.TSerializer
}
Serializer is an object that can stick around to provide convenience functions and allow object reuse
func NewThriftSerializer ¶
func NewThriftSerializer() *Serializer
NewThriftSerializer constructs a serializer with a default buffer of 1024
func (*Serializer) Serialize ¶
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