package thrift
import "github.com/apache/arrow/go/v11/parquet/internal/thrift"
Package thrift is just some useful helpers for interacting with thrift to make other code easier to read/write and centralize interactions.
Index ¶
- func DeserializeThrift(msg thrift.TStruct, buf []byte) (remain uint64, err error)
- func DeserializeThriftStream(msg thrift.TStruct, r io.Reader) error
- func SerializeThriftStream(msg thrift.TStruct, w io.Writer) error
- type Serializer
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.
func SerializeThriftStream ¶
SerializeThriftStream writes out the serialized bytes of the passed in type to the given writer stream.
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
Source Files ¶
- Version
- v11.0.0 (latest)
- Published
- Jan 18, 2023
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 2 days ago –
Tools for package owners.