A Pure Elixir Thrift Implementation
Go to file
2016-01-05 09:21:28 -08:00
ext Update our Thrift reference to version 0.9.3. 2015-10-16 09:35:34 -07:00
lib Create the output directory if it doesn't exist. 2015-01-08 16:19:39 -08:00
test Initial revision. 2015-01-06 17:51:59 -08:00
.gitignore Various build process enhancement 2016-01-04 20:33:19 -08:00
.gitmodules Initial revision. 2015-01-06 17:51:59 -08:00
.travis.yml Submit Coveralls coverage reports from Travis. 2016-01-05 09:21:28 -08:00
LICENSE Add a full copy of our Apache license. 2015-12-19 08:49:23 -08:00
mix.exs Various build process enhancement 2016-01-04 20:33:19 -08:00
README.md Submit Coveralls coverage reports from Travis. 2016-01-05 09:21:28 -08:00

Thrift Utilities for Elixir

Build Status Coverage Status

This package contains a handful of useful utilities for working with Thrift in Elixir.

In particular, it includes a copy of the Erlang Thrift runtime library.

Setup

Start by adding this package to your project as a dependency:

{:thrift, github: "pinterest/elixir-thrift", submodules: true}

Mix

This package includes a Mix compiler task that can be used to automate Thrift code generation. Start by adding :thrift to your project's :compilers list. For example:

compilers: [:thrift | Mix.compilers]

It's important to add :thrift before the :erlang entry. The Thrift compiler will generate Erlang source files, and we currently rely on this ordering to ensure those generated source files get compiled.

Next, define the list of :thrift_files that should be compiled. In this example, we gather all of the .thrift files under the thrift directory:

thrift_files: Mix.Utils.extract_files(["thrift"], [:thrift]),

By default, the generated source files will be written to the src directory, but you can change that using the thrift_output option.

You can also pass additional options to the Thrift compiler by listing them in the thrift_options option.