gateway

command module
v0.0.0-...-fd94cfd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2017 License: GPL-3.0 Imports: 27 Imported by: 0

README

service gateway

reportcard build godoc

Install

go get github.com/gomatic/gateway

Test

Install the example service

go get github.com/gomatic/service-example

Run the gateway

EXAMPLE_SERVICE_PORT=5000 gateway --debug >gateway.log 2>&1 & gateway_pid=$!

Test the gateway

curl -s localhost:3000/health         # The health check

debug routes

curl -s localhost:2999/header         # This debug route generates a JWT token
curl -s localhost:2999/debug/vars     # This debug route provides runtime information

Run the example service

API_PORT=5000 service-example --debug >service-example.log 2>&1 & service_pid=$!

Test the example 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

Call the example service through the gateway

curl -is -H "$(curl -s localhost:2999/header)" http://localhost:3000/v1/example/health
curl -is -H "$(curl -s localhost:2999/header)" http://localhost:3000/v1/example/api/model.json
RPC

Install the example RPC client

go get github.com/gomatic/service-example/cmd/service-example-client

Call the example service through the RPC using the client helper

API_PORT=5000 service-example-client this is a great example message
Cleanup
kill ${gateway_pid} ${service_pid}
rm gateway.log service-example.log

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL