Skip to content

Example code to demo using grpc-gateway with custom error Proto messages

Notifications You must be signed in to change notification settings

amitmahbubani/grpc-gateway-custom-errors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grpc-gateway-custom-errors

This repo contains sample code that demonstrates some of the customization capabilities in grpc-gateway

How To Run

Install deps:

  1. Install protobuf
  2. Install grpc binaries:
go install \
    github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway \
    github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger \
    github.com/golang/protobuf/protoc-gen-go

Run:

  1. go run server/app/main.go
  2. go run server/gateway/main.go
  3. go run client/main.go

Proto files and compiling

To generate server code:

protoc -I. -I./proto --go_out=plugins=grpc,paths=source_relative:./proto_generated proto/user/user.proto

To generate grpc-gateway code:

protoc -I. -I./proto/. --grpc-gateway_out=logtostderr=true,paths=source_relative:./proto_generated proto/user/user.proto

error proto:

protoc -I. --go_out=plugins=grpc,paths=source_relative:./  errors/error.proto

Examples

todo

About

Example code to demo using grpc-gateway with custom error Proto messages

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages