GoBuzz is an example of an HTTP server providing REST API functionality using in-memory storage. Project has been inspired by @katezien speech about hex-domain architecture. Application is currently in build process. Used: HTTP light-weight router @chi, BDD framework: @Ginkgo together with matcher/assertion library @Gomega.
Assumptions:
- Server is listining on localhost with port 8080
- Payload has been limited up to 1 MB per POST request
- Worker has five seconds tiemout for fetching URL
- Worker fetches data in background with provided interval time in seconds.
- Request ID must be an int value.
Creating new Post Request:
curl -si 127.0.0.1:8080/api/fetcher -X POST -d '{"url": "https://httpbin.org/range/15","interval":60}'
For testing purposes only https://httpbin.org/range or https://httpbin.org.delay path are accepted. If duration for fetching url content will be longer than 5s inside response storage response record will be stored as nil value.
In progress:
- Adding rest of funcionality for handling PUT, DELETE requests.
- Listing global history of created requests and specific fetch response storage data.