Demonstrates building example gRPC servers with OpenAPI (Swagger) annotations in Go using Gunk definitions.
File | Description |
---|---|
.gunkconfig | Gunk project configuration |
main.go | gRPC server implementation |
cmd/gunk-example-server-gw/main.go | REST gateway and Swagger docs |
api/v1/util.gunk | Gunk echo service example |
api/v1/countries.gunk | Gunk countries service example |
# clone
$ git clone https://github.com/gunk/gunk-example-server.git && cd gunk-example-server
# install protobuf tools / generator dependencies
$ ./install.sh
# build and run gRPC server
$ go build && ./gunk-example-server
# build and run REST gateway and Swagger doc site
$ go build ./cmd/gunk-example-server-gw && ./gunk-example-server-gw
# test
$ ./test.sh
The OpenAPI (ie, Swagger) definitions can be viewed with ReDoc by visiting localhost:9091/redoc.