The http gateway runs accepts http requests and trasforms those to messages emitted on the broker.
Optionally (when posting to the /requests/{topic}
endpoint) it waits for a reply on a dedicated internal topic
and marshalls that message as an http response.
The following tools are required to build this project:
-
make
-
Docker
-
Glide for dependency management
If you intend to re-generate mocks for testing, install:
If you would like to run tests using the ginkgo
command, install:
cd $(go env GOPATH) #defaults to ~/go
git clone -o upstream https://github.com/projectriff/http-gateway src/github.com/projectriff/http-gateway
-
To build locally (this will produce a binary named
http-gateway
on your machine):make build
-
To build for docker (and deploy as part of the whole riff installation):
make dockerize
This assumes that your docker client is correctly configured to target the daemon where you want the image built.
-
To run tests:
make test
-
To attach a delve capable debugger (such as Goland) to an
http-gateway
running inside k8s:make debug-dockerize
Then expose the
2345
port as a service, usingriff/config/delve/http-gateway-debug.yaml
:kubectl apply -f riff/config/delve/http-gateway-debug.yaml
Then you can connect the debugger through port
30100
.