package
0.0.0-20170510072740-577d9949a035
Repository: https://github.com/yoheimune/grpc-playground.git
Documentation: pkg.go.dev

# README

gRPC Gateway Sample

This is a sample of gRPC Gateway.

Pre installed

It assumes that you have read the Project Root README and followed the instruction.

Install another plugins for protoc.

$ go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
$ go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger

Proto file

How to convert

Stub

$ protoc -I. \
    -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
    --go_out=plugins=grpc:. \
    *.proto

This will generate a stub profile.pb.go.

Gateway

$ protoc -I. \
    -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
    --grpc-gateway_out=logtostderr=true:. \
    *.proto

This will generate a stub profile.pb.gw.go.

Implementation

Test

# Launch.
$ go run server/main.go
$ go run gateway/main.go

# Test.
$ curl -d '{"value":"aaa"}' http://localhost:8080/v1/example/echo
{"value":"aaa"}

More examples

https://github.com/grpc-ecosystem/grpc-gateway/tree/master/examples

References

https://github.com/grpc-ecosystem/grpc-gateway

# Packages

No description provided by the author
No description provided by the author

# Functions

No description provided by the author
RegisterProfileHandler registers the http handlers for service Profile to "mux".
RegisterProfileHandlerFromEndpoint is same as RegisterProfileHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
No description provided by the author

# Structs

No description provided by the author

# Interfaces

No description provided by the author
No description provided by the author