grpc

Compiling Proto File

I always forgot how to compile proto file and here is how compile .proto file for my personal note. 😀

$ protoc -I proto_dir/ proto_dir/proto_file.proto --go_out=plugins=grpc:proto

Example above for golang implementation, another programming language can use another out parameter.

  --cpp_out=OUT_DIR           Generate C++ header and source.
  --csharp_out=OUT_DIR        Generate C# source file.
  --java_out=OUT_DIR          Generate Java source file.
  --js_out=OUT_DIR            Generate JavaScript source.
  --objc_out=OUT_DIR          Generate Objective C header and source.
  --php_out=OUT_DIR           Generate PHP source file.
  --python_out=OUT_DIR        Generate Python source file.
  --ruby_out=OUT_DIR