Skip to content

Service performs http requests to registered service in case of event published

Notifications You must be signed in to change notification settings

volodimyr/publisher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Publisher

Service performs http requests to registered service in case of event published Usually service starts at http://localhost:8080.

The next endpoints are available:
  1. Listener registration POST /listener Body: {"event": "event_name1", "name": "listener_name_1", "address": "http://listener.address/handle"}
  2. Listener unregister DELETE /listener/listener_name_1
  3. Publish event POST /publish/{event} Body: json

Run tests

$ make test

or run go test ./...

Run server locally

$ make run

It executes go run cmd/main.go under the hood. Which is the entry point for the api. Control + C if you want to drop server

Build & Run docker image

$ make docker-build-run

It executes: docker image build -t publisher:latest . && docker container run -d -p 8080:8080 --name publisher publisher under the hood

or you can use the next commands one by one

$ make docker-build

and

$ make docker-run

If you want to stop and remove image then use next command

$ make docker-stop

It executes: docker stop publisher && docker rm publisher under the hood

About

Service performs http requests to registered service in case of event published

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published