Skip to content
This repository has been archived by the owner on Jun 9, 2019. It is now read-only.

Generates RPC server and client code from protocol buffer declarations

Notifications You must be signed in to change notification settings

jcayzac/protorpc-generator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ProtoRPC generators

Requirements

Well, of course, libprotobuf. If you install through MacPorts, then this should be enough:

$ sudo port install protobuf-cpp protobuf-pythonVERSION # protobuf-python25, protobuf-python26 or protobuf-python27

You should avoid installing the protobuf library for the same version of Python as your Google App Engine development server uses, as it will conflict with another protobuf package bundled in the latter. I use Python 2.7 system wide and let GAE be the only thing that still uses old Python 2.5.

Note that the installation seems broken, so google.protobuf.compiler cannot be imported because of a missing file. You can create it with this command:

$ sudo python -c 'import os, google.protobuf; open("%s/compiler/__init__.py"%google.protobuf.__path__[0], "w");'

How to generate the example service

Running the following:

$ cd example && ../bin/proto2rpc hello.proto

...will create these source files:

gen_rpc_client_cpp:
    hello.pb.cc  hello.pb.h

gen_rpc_client_objc:
    hello.rpc.h  hello.rpc.mm

gen_rpc_services:
    __init__.py  hello.py

Testing the example service

Assuming you running app.yaml on port 8081,

$ echo "my_name:'$USER'" | \
    protoc --encode=hello.HelloRequest hello.proto | \
    curl 2>/dev/null -H 'content-type:application/x-google-protobuf' \
        --data-binary @- http://localhost:8081/rpc/HelloService.hello | \
    protoc --decode=hello.HelloResponse hello.proto
hello: "Hey, hello jcayzac!"

About

Generates RPC server and client code from protocol buffer declarations

Topics

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 72.3%
  • Objective-C 26.7%
  • Shell 1.0%