https://github.com/gomatic/service-example
gRPC+RESTful gateway client-server example.
https://github.com/gomatic/service-example
Last synced: about 1 year ago
JSON representation
gRPC+RESTful gateway client-server example.
- Host: GitHub
- URL: https://github.com/gomatic/service-example
- Owner: gomatic
- License: gpl-3.0
- Created: 2017-05-07T03:35:56.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-31T01:46:59.000Z (about 9 years ago)
- Last Synced: 2025-03-25T07:01:58.099Z (over 1 year ago)
- Language: Go
- Size: 29.3 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# service example
[](https://goreportcard.com/report/github.com/gomatic/service-example)
[](https://travis-ci.org/gomatic/service-example)
[](https://godoc.org/github.com/gomatic/service-example)
[](http://www.gnu.org/licenses/gpl-3.0)
## Install
go get github.com/gomatic/service-example
## Test
**Run the service**
API_PORT=5000 service-example --debug >service-example.log 2>&1 & service_pid=$!
**Test the service**
curl -s localhost:5000/health # The health check
curl -s localhost:5000/api/model.json # The OpenAPI documentation
debug routes
curl -s localhost:4999/debug/vars # This debug route provides runtime information
### RPC
**Install RPC client helper**
go get github.com/gomatic/service-example/cmd/service-example-client
**Call the service through the RPC using the client helper**
API_PORT=5000 service-example-client this is a great example message
### Cleanup
kill ${service_pid}
rm service-example.log # Maybe have a look at the log before doing this.