Coder Social home page Coder Social logo

protoc-gen-rest's Introduction

VoyTechnology

Repository with my personal site

protoc-gen-rest's People

Contributors

voytechnology avatar

Watchers

 avatar  avatar

protoc-gen-rest's Issues

Path Match on GET Request

Because we do not support input data, we would want to match parts of the request path and match it to the request.

eg.

rpc Multiply(Request) returns (Response) {
  option (google.api.http) = {
    get: "/multiply/{a}/{b}"
  };
}
message Request {
  int a = 1;
  int b = 2;
}
GET /multiply/2/3
6
func (s *Server) Multiply(ctx context.Context, req *pb.Request) (*pb.Response, error) {
  fmt.Println(req) // { A: 2, B: 3 }
  return &pb.Response{Result: req.A * req.B}, nil
}

Generate Client Code

Generate the client side code so that you can use http.Client to make requests.

Compatibility with connect-go

While we cannot implement compatibility with every other protoc generator, connect-go looks like it might be a good fit

https://connect.build

This would be possibly done with a opt

library_compat=connect-go

With default being ""

Conditionally create service interface

The service interface should only be created conditionally - if the server already has gRPC generated, we should not generate it again.
Perhaps this can be done with a generator option:

service_interface: false

Generate Server Code

Generate server side code. This should return a http.Handler which will listen to the incoming HTTP requests and use the provided server interface to call the service methods.

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.