Skip to content

jbryanmiller/grpc-rest-example

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gRPC / REST Gateway sample app

This is a demo app for building a service in Go, then exporting it with a REST and gRPC API.

Screenshot of REST API Explorer

Quickstart

make will start the server. You can then either:

  • navigate to http://localhost:5000/swagger-ui for the REST docs & interacter
  • cd ruby && bundle exec bin/rest_client.rb localhost:5000 to run the ruby client against the REST API
  • cd ruby && bundle exec bin/grpc_client.rb <grpc host> to run the ruby client against the gRPC API

How the app is built

Service definition

releases.proto

This contains the main definition of the types, and APIs in use.

Server

go/server/main.go

Actually starts the servers

Service implementation

go/server/releaser/service.go

Implementation of the service

Ruby gRPC client

ruby/bin/grpc_client.rb

Consumes the generated gRPC client in ruby/lib

Ruby REST client

ruby/bin/rest_client.rb

Consumes the generated REST/Swagger client gem in ruby/releases_client

Generation

All code generation is triggered in the Makefile

API Documentation

Can be generated statically, but the Dynamic version version is fun. See the quickstart. The gem has documentation generated in ruby/releases_client/doc

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 92.8%
  • Go 2.9%
  • Makefile 2.2%
  • Shell 2.1%