Skip to content

chaseajen/proto-hack

 
 

Repository files navigation

proto-hack

Hacklang generator for protobuf

Dependencies

  • golang
  • hhvm
  • protoc

Installation

go get -u github.com/y3llowcake/proto-hack/protoc-gen-hack

protoc-gen-hack should now be in your $PATH

Usage

protoc --hack_out=./gen-src example.proto

To include gRPC service stubs: protoc --hack_out=plugin=grpc:./gen-src example.proto

In addition to generated code, you will need the library code in /lib.

  $msg = new ExampleMessage();
  $raw = Protobuf\Marshal($msg);
  $msg2 = new ExampleMessage(); 
  Protobuf\Unmarshal($raw, $msg);

Development

make test

Notes

  • Unsigned 64 bit integer types (e.g. uint64, fixed64) are represented using their signed counterparts, with the top bit simply being stored in the sign bit. (similar to java).

Recommendations

  • Avoid unsigned 64 bit types (uint64, fixed64)

About

hacklang generator for protobuf

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Hack 83.6%
  • Go 15.2%
  • Other 1.2%