Skip to content

bhaweshksingh/event_history

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Event Historization service

Pre requisites

  • Docker
  • Golang v1.14+

Running App

  1. Export DB_PASSWORD export DB_PASSWORD="S3cretP@ssw0rd"

  2. Bring up the mysql container using:

make infra-local

  1. Run the migrations on the local DB

make setup

  1. Build and run the app container.

make app

  1. Inspect logs using docker

docker logs event-history-go -f

Verifying the Functionality

Create key Request

curl -X POST 'http://localhost:8080' \
--header 'Content-Type: application/json' \
--data-raw '{
    "key": "name",
    "user_id": "user1",
    "value": "john"
}'

Update key Request

curl -X PUT 'http://localhost:8080/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "key": "name",
    "user_id": "user1",
    "value": "Sam"
}'

GET historised answer Req

curl -X GET 'http://localhost:8080/user1/name'

GET latest answer Req

curl -X GET 'http://localhost:8080/latest/user1/name'

Delete key Req

curl -X DELETE 'http://localhost:8080/user1/name'

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published