Giter Club home page Giter Club logo

elm-protobuf's Introduction

elm-protobuf

Build Status Go Report Card

Join #elm-protobuf on Slack

Experimental protobuf plugin generating elm code from proto definitions.

The plugin itself is written in Go, and it requires the base protoc protobuf compiler to be installed on the system.

For a sample generated output file, see https://github.com/tiziano88/elm-protobuf/blob/master/protoc-gen-elm/go_tests/testdata/repeated/expected_output/Repeated.elm

Supported features

  • double/float fields
  • int32/int64/uint32/uint64/sint32/sint64/fixed32/fixed64/sfixed32/sfixed64 fields
  • bool fields
  • string fields
  • bytes fields
  • message fields
  • enum fields
  • imports
  • nested types
  • Any type
  • Timestamp type
  • Duration type
  • Struct type
  • wrapper types
  • FieldMask type
  • ListValue type
  • Value type
  • NullValue type
  • oneof
  • map
  • packages
  • options

How to install

Release

The simplest way to install the plugin is to download a pre-compiled binary from https://github.com/tiziano88/elm-protobuf/releases , then unpack it and copy or move the protoc-gen-elm binary somewhere in your $PATH.

From source

  • Make sure that you have a Go environment correctly set up, and that $GOPATH/bin is included in your $PATH. See https://golang.org/doc/install for info.

  • Install a recent protoc compiler version from https://github.com/google/protobuf (it must have support for proto3 format).

  • Obtain the protoc-gen-elm binary using go get:

    go get github.com/tiziano88/elm-protobuf/protoc-gen-elm
    

How to run

Run the protoc compiler specifying the --elm_out flag:

protoc --elm_out=. *.proto

protoc will automatically detect the protoc-gen-elm binary from your $PATH and use it to generate the output elm code.

Then, in your project, add a dependency on the runtime library:

elm package install tiziano88/elm-protobuf

References

https://developers.google.com/protocol-buffers/

https://developers.google.com/protocol-buffers/docs/proto3#json

https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.compiler.plugin.pb

https://github.com/google/protobuf/wiki/Third-Party-Add-ons

elm-protobuf's People

Contributors

donpdonp avatar tiziano88 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.