elm-protobuf

protobuf plugin for elm

Github星跟蹤圖

elm-protobuf

Build Status
Go Report Card

Join #elm-protobuf on Slack

Experimental protobuf plugin generating elm code to decode/encode Proto3/JSON 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
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 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

主要指標

概覽
名稱與所有者tiziano88/elm-protobuf
主編程語言Elm
編程語言Go (語言數: 4)
平台
許可證MIT License
所有者活动
創建於2016-02-08 10:16:11
推送於2022-11-14 03:55:36
最后一次提交2019-04-09 12:39:07
發布數10
最新版本名稱3.0.0 (發布於 2018-09-17 22:29:13)
第一版名稱v0.0.1 (發布於 )
用户参与
星數94
關注者數4
派生數28
提交數213
已啟用問題?
問題數11
打開的問題數5
拉請求數9
打開的拉請求數6
關閉的拉請求數5
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?