Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

longkai/grpc-showcase

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gRPC Showcase

This is a gRPC best practise repo, which contains:

  • Google API design for gRPC and HTTP REST service
  • protocol buffers code gen via docker image, so you don't need to install all the toolchain
  • best practise for writing a gRPC service
  • multi-stage docker build with distroless image
  • runs on Kubernetes and Istio
  • integrates gRPC health probe protocol
  • gRPC-JSON transcoder in Istio envoy sidecar, so you can call gRPC service via HTTP REST JSON requests
  • cutting edge technology
  • automation all the workflows

Up and Running

You must have a working Kubernetes and Istio environment and config its ingress, simply run,

$ make deploy

Then test the gRPC client(requires Go),

$ go build -o cli ./cmd/cli
$ ./cli -addr=localhost:80 -name=World # replace with your server address
2020/05/05 13:35:48 Greeting: Hello World

Or just play with curl,

$ curl -d '{"name": "World"}' "localhost/v1/say" # replace with your server address
{
 "message": "Hello World"
}

TODO

  • sending arbitrary http request body in addition to JSON
  • replying arbitrary http response body in addition to JSON
  • rich google error status
  • custom error
  • request params validation
  • testing
  • other gRPC features, like api listing, interceptor, etc.

If you have any questions or contributions feel free to file an issue.

Have fun!

About

a gRPC best practise repo which contains cutting edge technology and automation all the workflows

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.