Hacklang generator for protobuf
- golang
- hhvm
- protoc
go get -u github.com/y3llowcake/proto-hack/protoc-gen-hack
protoc-gen-hack should now be in your $PATH
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);
make test
- 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).
- Avoid unsigned 64 bit types (uint64, fixed64)