protobuf-elixir

A pure Elixir implementation of Google Protobuf

Why this instead of gpb or exprotobuf?

It will have some must-have and other cool features like:

  1. A protoc plugin to generate Elixir code like what other official libs do.
  2. Use structs for messages instead Erlang records.
  3. Generate simple and explicit code with the power of Macro. (see test/protobuf/dsl_test.exs)
  4. Support Typespec in generated code.

Installation

If available in Hex, the package can be installed by adding protobuf to your list of dependencies in mix.exs:

def deps do
[{:protobuf, "~> 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/protobuf.

TODO

Acknowledgements

Many thanks to gpb and golang/protobuf as good examples of writing Protobuf decoder/encoder.