railway_ipc v0.3.2 RailwayIpc.Core.MessageFormat.JsonProtobuf
This is an internal module, not part of the public API.
Messages that use the JsonProtobuf
format have the following
characteristics:
The payload s a struct that contains two attributes:
type
andencoded_message
The
type
attribute is the name of the Elixir module for the protobuf without the "Elixir" prefix and uses colon notation instead of dotsThe
encoded_message
attribute is the protobuf in map formThe entire payload is then converted to JSON
Note: I think the reason for converting to colon notation is an artifact of wanting to be compatable with the Ruby version since Ruby classes use colon notation. -BN
Link to this section Summary
Functions
Decodes the given message
into a Protobuf struct
.
Encodes the given protobuf
by creating a JSON string with two attributes
Link to this section Functions
decode(message)
Decodes the given message
into a Protobuf struct
.
encode(protobuf)
Encodes the given protobuf
by creating a JSON string with two attributes:
type
-- the Protobuf module name as a string using colon notationencoded_message
-- the Protobuf converted to a map