We need go1.13 or greater
go get github.com/kukkar/mta-hosting-optimizer
- Recovery (It will recover from any panic in endpoint and won't stop the server)
- Debug (It will add context value to debug the SQL, Error stack trace, Request and Response on-demand)
- Logger (gin default logger is used to log url hit, response time and response status)
- CORS (Cross-origin resource sharing)
- GET / (check server is running)
- GET /swagger/docs.json (for swagger if you have created swag document)
- GET /debug/pprof/ (To view all available profiles)
- GET /debug/pprof/cmdline (running program's command line, with arguments separated by NUL bytes)
- GET /debug/pprof/profile (CPU profile)
- POST /debug/pprof/symbol
- GET /debug/pprof/symbol
- GET /debug/pprof/trace (execution trace)
- GET /debug/pprof/allocs
- GET /debug/pprof/block (to look at the goroutine blocking profile)
- GET /debug/pprof/goroutine (Goroutine profile report the stack traces of all current goroutines.)
- GET /debug/pprof/heap (to look at the heap profile)
- GET /debug/pprof/mutex (to look at the holders of contended mutexes)
- GET /debug/pprof/threadcreate (Thread creation profile reports the sections of the program)
- GET /otp/healtcheck (healtcheck on service based on config)
- to build docker run
- sudo docker build -t mta-hosting-optimizer -f Dockerfile .
- to run docker image
- docker run mta-hosting-optimizer
- to run go tests
- go test ...
go tool cover -func=coverage.out github.com/kukkar/mta-hosting-optimizer/src/mta-hosting-optimizer/mtaHostingOptimizerImpl.go:15: GetInefficientHosts 100.0% github.com/kukkar/mta-hosting-optimizer/src/mta-hosting-optimizer/mysqlImpl.go:13: getInactiveIPHosts 91.7% total: (statements) 95.2% admin@admins-MacBook-Pro mta-hosting-optimizer %