Skip to content

disco07/grpc-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

example-go-grpc-gateway

Prerequisites

# Installe le plugin protoc pour générer du code Go
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest

# Installe le plugin protoc pour générer les services gRPC en Go
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest

# Installe le plugin pour générer le code de la passerelle gRPC
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latest

# (Optionnel) Installe le plugin pour générer la spécification OpenAPI
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@latest

export PATH="$PATH:$(go env GOPATH)/bin"

Tested with:

grpcurl -d '{"a": 1} {"a": 5} {"a": 3} {"a": 6} {"a": 2} {"a": 15}' -plaintext localhost:50051 calculator.CalculatorService/Max
curl -X POST \
  http://localhost:8080/v1/calculator/add \
  -d '{"a": 5, "b": 3}' \
  -H "Content-Type: application/json"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors