func GracefulStop(stop func()) {
	signalChan := make(chan os.Signal, 1)
	signal.Notify(
		signalChan,
		syscall.SIGHUP,   
		syscall.SIGINT,   
		syscall.SIGTERM,  
		syscall.SIGQUIT,  
	)
	<-signalChan
	log.Print("os.Interrupt - shutting down...\n")
	go func() {
		<-signalChan
		log.Fatal("os.Kill - terminating...\n")
	}()
	stop()
	os.Exit(0)
}
GracefulStop handles signal and graceful shutdown by executing callback function
when signal is received callback is called followed after by os.Exit(0), it is responsibility of callback to handle timeout
if second signal is received will terminate process by a call to os.Exit(1)
package shutdown
import (
	"log"
	"os"
	"os/signal"
	"syscall"
)