Categorygithub.com/AkashGit21/mta-hosting-optimizer
module
0.0.0-20230911150301-a04172bf3b66
Repository: https://github.com/akashgit21/mta-hosting-optimizer.git
Documentation: pkg.go.dev

# README

mta-hosting-optimizer

Short description

Currently, about 35 physical servers host 482 mail transfer agents (MTAs) each having a dedicated public IP address. To be economical while hosting MTAs as a software engineer I want to create a service that uncovers the inefficient servers hosting only few active MTAs.

Acceptance Criteria

  • Project with the name “mta-hosting-optimizer”.
  • A major programming language (Golang) is utilized to build the service.
  • A HTTP/REST endpoint to retrieve hostnames having less or equals X active IP addresses exists.
  • X is configurable using an environment variable, the default value is set to 1.
  • IP Configuration data (IpConfig) is provided by a mock service using sample data below.
  • Unit & integration tests are present.
  • Code coverage exceeds 90%.
  • Integrate the test and build phases to Github action.

Setup required

  1. Golang v1.20+ (or 1.16+ should also work)
  2. make (to execute the commands from Makefile)

Steps to run the application locally

  1. Fetch all golang dependencies by typing the following from root directory:
        go mod download
    
  2. Configure the sample data in similar format in the data.json file present within ipconfig directory.
  3. Run the application by typing the following from root directory:
        make run
    
  4. Navigate from your browser to http://localhost:8082/hosts/inefficient.

Features / Points added

  1. Logging mechanism
  2. Panic recover handler
  3. Github workflow -> test and build phases
  4. env file separation
  5. Unit/Integration test cases

Scope of Improvement

  1. Addition of Dockerfile to enhance collaboration.

# Packages

No description provided by the author