grpc-gateway-example

command module
v0.0.0-...-6de2aca Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

README

gRPC + REST Gateway Play

Experimentations around grpc-gateway

master branch A modified version of the grpc-gateway-example to have both HTTP and gRPC on the same port, without TLS. Server implementation is largely inspired from Zenithar/go-password.

gorilla-mux grpc-gateway-example modified to use gorilla/mux as HTTP handler for routes standing aside of grpc-gateway.

Installation & usage

To try it all out do this:

$ go get -u github.com/Stoakes/grpc-gateway-example
$ grpc-gateway-example serve
# In another terminal
$ grpc-gateway-example echo "my first rpc echo"
$ curl -X POST -k http://localhost:10000/v1/echo -H "Content-Type: text/plain" -d '{"value": "foo"}'

Features

  • A basic echo service returning value send as parameter. Available on port 10000, in both HTTP & GRPC, without TLS.
  • A swagger description of the service at localhost:10000/swagger.json
  • A swagger UI to interact with the REST API at localhost:10000/swagger-ui/

Mentions from the initial README

Blog post: https://coreos.com/blog/gRPC-protobufs-swagger.html

Huge thanks to the hard work people have put into the Go gRPC bindings and gRPC to JSON Gateway

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package echopb is a generated protocol buffer package.
Package echopb is a generated protocol buffer package.
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL