neda1985 / getir

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getir Case

Getir technoical challenge

build and Run Project on local

With Docker:

$ docker build -t getir .
$ docker run -d -it -p 8080:8080 --name getir getir

pull image from dockerhub

$ docker pull nedad/challenge:getir

Run Test

  • go test ./...

APIS (deployed on AWS ECS)

  • /fetch | http://18.234.166.11:80/fetch post request with bellow example
  • /in-memory | http://18.234.166.11:80/in-memory get and post as example bellow

Mongo Search

URL : /fetch

Method : POST

Data example

{
  "startDate": "2016-01-21",
  "endDate": "2016-03-02",
  "minCount": 2900,
  "maxCount": 3000
}

Success Response

Code : 200

Content example

{
  "code": 0,
  "msg": "Success",
  "records": [
    {
      "createdAt": "2016-02-19T08:35:39.409+02:00",
      "key": "GjhjVIKb",
      "totalCount": 2774
    }
  ]
}

Insert Data to memory

URL : /in-memory

Method : POST

Data example

{
    "key": "test_key",
    "value": "test_value"
}

Success Response

Code : 201

Content example

{
  "key": "test_key",
  "value": "test_value"
}

Get Data from memory

  • GET /in-memory

Get Data

URL : /in-memory?key={test_key}

Method : GET

Success Response

Code : 200

Content example

{
  "key": "test_key",
  "value": "test_value"
}

About


Languages

Language:Go 98.1%Language:Dockerfile 1.9%