Flatbuf (flatbuf v0.1.0)

Copy Markdown View Source

flatbuf — pure-Elixir FlatBuffers with compile-time, file-emitting code generation.

The user-facing entry points are the Mix tasks (mix flatbuf.gen) and the resolver/codegen modules:

Generated code is dependency-free: a project can mix flatbuf.gen and drop :flatbuf from deps without breaking anything.

Summary

Functions

Convenience: parse, resolve, and generate from a schema file.

Functions

generate_from_path(path, opts \\ [])

@spec generate_from_path(
  Path.t(),
  keyword()
) :: {:ok, [{module(), String.t()}]} | {:error, term()}

Convenience: parse, resolve, and generate from a schema file.

Returns the list of {module_name, source_string} artifacts the way Flatbuf.Codegen.generate/2 does. Useful for scripts and tests; the Mix task is the supported workflow.