Git Product home page Git Product logo

play-protobuf's Introduction

play protobuf

This library provides a way to easily handle protobuf objects as input and output in play controllers. There is also functionality to build controllers are routes from gRPC definitions in proto files.

Internals

Extend ProtobufParser class with your protobuf class as part of the definition. Use it as a typical play bodyparser See test/java/protos/com/example/tutorial/PhoneNumberParser.java as an example parser and test/java/protos/com/example/tutorial/HomeController.java as a sample controller

Code Generation

Use the ServiceCodeGeneratorUtil class to generate controllers, parsers, and routes from proto files that have gRPC style definitions. Example: new ServiceCodeGeneratorUtil().generateClassFiles("service.proto", "app", true); new ServiceCodeGeneratorUtil().generateRoutesFiles("service.proto", "conf/routes");

Testing

./sbt test

Building

./sbt packageLocal

Other stuff

protoc --encode tutorial.Person.PhoneNumber protos/addressbook.proto < /tmp/in > /tmp/to

protoc --decode tutorial.Person.PhoneNumber protos/addressbook.proto < /tmp/t

protoc -I=protos/ --java_out=app/ protos/addressbook.proto

protoc --plugin=protoc-gen-grpc-java=/usr/local/bin/protoc-gen-grpc-java --grpc-java_out=app --proto_path="protos" protos/service.proto

nghttpx -s -f"0.0.0.0,9001;no-tls" -b127.0.0.1,9000

play-protobuf's People

Contributors

lawrencefinn avatar

Stargazers

Me, myself and I avatar  avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.