Skip to content

Latest commit

 

History

History
44 lines (37 loc) · 1.2 KB

README.md

File metadata and controls

44 lines (37 loc) · 1.2 KB

Golang Case Study

Description

This project consists of two main parts

  • A job that processes JSON Lines files to write data to database.
  • A microservice that provides and endpoint to fetch records by ID

Installation

  • Clone the repository:
git clone https://[email protected]/emresinspace/cimrijob.git
  • Create an .env file using .env.example and fill it with required credentials.
  • To build the images use
docker-compose build
  • To run the project:
docker-compose up

Then everything will be ready.

For demonstration purposes job and microservice is starting at the same time and job runs only one time. After job is completed data will be available to retrieval from the service.

Here is a sample request for id=1000:

curl --location --request GET 'http://127.0.0.1:8080/product/1000'

Response:

{
    "id": 1000,
    "price": 63816.95,
    "title": "title1000",
    "category": "cep-telefonlari",
    "brand": "lg",
    "url": "http://site.example.com/?id=1000",
    "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam vel elit tortor. Fusce posuere ante sollicitudin risus tempus, quis accumsan tortor accumsan."
}