ExMsgpax provides extensions for Msgpax to support tuple, naive datetime, etc.
ExMsgpax uses the Extention Types of MessagePack for data types which aare not supported by Msgpax.
Type | Code | Remarks |
---|---|---|
Atom | 0 | Atom types are converted to atom types, not strings. |
NaiveDateTime | 1 | |
Date | 2 | |
Time | 3 | |
Tuple | 4 | |
Structs | 5 | |
Exceptions | 6 |
iex> ExMsgpax.pack {1, 2, 3}
{:ok, <<214, 4, 147, 1, 2, 3>>}
iex> ExMsgpax.unpack <<214, 4, 147, 1, 2, 3>>
{:ok, {1, 2, 3}}
If available in Hex, the package can be installed
by adding ex_msgpax
to your list of dependencies in mix.exs
:
def deps do
[
{:ex_msgpax, "~> 0.1.0"}
]
end
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/ex_msgpax.