Protox v0.7.0 Protox

Use this module to generate the Elixir modules from a set of protobuf definitions:

  defmodule Foo do
    use Protox, files: [
      "./defs/foo.proto",
      "./defs/bar.proto",
      "./defs/baz/fiz.proto",
    ]
  end

Note that the files should reside in the same sub-directory.

It’s also possible to directly give a schema:

  defmodule Bar do
    use Protox, schema: """
      syntax = "proto3";
      package fiz;

      message Baz {
      }

      message Foo {
        map<int32, Baz> b = 2;
      }
    """
  end

The generated modules respect the package declaration. For instance, in the above example, both the Fiz.Baz and Fiz.Foo modules will be generated.