Filo.Protobuf.Ws (Filo v0.2.0)

Copy Markdown View Source

Protobuf codec for the Hrana 3 over WebSocket messages: ClientMsg (hello / request) and ServerMsg (hello_ok / hello_error / response_ok / response_error), plus the RequestMsg / ResponseOkMsg request- and response-oneofs. Maps to and from the same message maps Filo.Socket already dispatches on, so the socket only swaps text-JSON framing for binary-protobuf framing. Shared structures come from Filo.Protobuf.

Summary

Functions

decode_client_msg(bin)

@spec decode_client_msg(binary()) :: map() | nil

decode_server_msg(bin)

@spec decode_server_msg(binary()) :: map() | nil

encode_client_msg(m)

@spec encode_client_msg(map()) :: iodata()

encode_server_msg(map)

@spec encode_server_msg(map()) :: iodata()