# 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
- Golang v1.20+ (or 1.16+ should also work)
- make (to execute the commands from Makefile)
Steps to run the application locally
- Fetch all golang dependencies by typing the following from root directory:
go mod download
- Configure the sample data in similar format in the
data.json
file present withinipconfig
directory. - Run the application by typing the following from root directory:
make run
- Navigate from your browser to
http://localhost:8082/hosts/inefficient
.
Features / Points added
- Logging mechanism
- Panic recover handler
- Github workflow -> test and build phases
- env file separation
- Unit/Integration test cases
Scope of Improvement
- Addition of Dockerfile to enhance collaboration.
# Packages
No description provided by the author