Module otter_lib_thrift

This module facilitates encoding/decoding of thrift data encoded with the binary protocol.

Description

This module facilitates encoding/decoding of thrift data encoded with the binary protocol.

Function Index

decode/1Decodes a binary to {{Id, Type, Data}, Rest} tuple and rest of data.
decode_implicit_list/1Decodes a binary input as implicit list to a thrift decoded data structure, i.e.
encode/1Encodes a {Id, Type, Data} tuple to binary.
encode_implicit_list/1Encodes a list of thrift data structures to binary e.g.

Function Details

decode/1

decode(BinaryData::binary()) -> {{Id::integer(), Type::atom(), Data::term()}, Rest::binary()}

Decodes a binary to {{Id, Type, Data}, Rest} tuple and rest of data.

decode_implicit_list/1

decode_implicit_list(BinaryData::binary()) -> term()

Decodes a binary input as implicit list to a thrift decoded data structure, i.e. list of {Id, Type, Value} tuples. Implicit list is e.g. how OpenZipkin expects the spans to be send. It is called implicit as it does not contain a list type tag in the beginning.

encode/1

encode(X1::{Id::integer(), Type::atom(), Data::term()}) -> binary()

Encodes a {Id, Type, Data} tuple to binary.

encode_implicit_list/1

encode_implicit_list(Data::term()) -> binary()

Encodes a list of thrift data structures to binary e.g. to be sent on the wire.


Generated by EDoc, May 26 2017, 14:22:06.