this repository basically implementing limiter rate (Token Bucket Algorithm) and cache (CQRS pattern) on golang using echo framework (https://echo.labstack.com/), postgresql and redis.
- run
make localto install or up or run the postgres container and redis container. - make sure the docker postgres or container postgres is running and make database on the postgres container with name
test_cache_cqrsand run the sql script on the directorymigrations - make sure redis container is up and running
- make sure the config on config.local.yaml is correct
make runor simply with go command
go run main.goGET localhost:1234/api/v1/articles?page=0&size=1&query=placeget list article curl
curl --location 'localhost:1234/api/v1/articles?page=0&size=1&query=place'GET localhost:1234/api/v1/articles/12Get Detail Article curl
curl --location 'localhost:1234/api/v1/articles/12'POST localhost:1234/api/v1/articlescreate article curl
curl --location 'localhost:1234/api/v1/articles' \
--header 'Content-Type: application/json' \
--data '{
"author": "radiohead",
"title": "jigsaw falling into place",
"body": "<div>Just as you take my hand<br>Just as you write my number down<br>Just as the drinks arrive<br>Just as they play your favourite song<br>As your bad day disappears<br>No longer wound up like a spring<br>Before you'\''ve had too much<br>Come back in focus again<br>"
}'