commit | 6395e2724fe2e71b03c60960e9703100d4fb456c | [log] [tgz] |
---|---|---|
author | Takeru Ohta <phjgt308@gmail.com> | Sat Jan 18 13:29:40 2020 +0900 |
committer | Takeru Ohta <phjgt308@gmail.com> | Sat Jan 18 13:29:40 2020 +0900 |
tree | e3a34c240dcf57612e6c9e675e22892972531100 | |
parent | eded4916f0091362fe011a397091dc1a335b9e14 [diff] |
Add `thrift_protocol:{decode_struct/2, encode_struct/2}`
An Erlang implementation of Thrift protocol.
Body = #thrift_protocol_struct{ fields = #{1 => true, 2 => {i8, -1}} }, Message = #thrift_protocol_message{ method_name = <<"foo">>, message_type = call, sequence_id = 0, body = Body }, Encoded = list_to_binary(thrift_protocol:encode_message(Message, compact)), <<130,33,0,3,102,111,111,17,19,255,0>> = Encoded, {Decoded, <<>>} = thrift_protocol:decode_message(Encoded, compact), Message = Decoded.