This is a highly edited project (in order to make it work with Iris), original project is located here.
Enables graceful shutdown for the Iris web framework.
package main
import (
"github.com/iris-contrib/graceful"
"github.com/kataras/iris"
"time"
)
func main() {
api := iris.New()
api.Get("/", func(c *iris.Context) {
c.Write("Welcome to the home page!")
})
graceful.Run(":3001", time.Duration(10)*time.Second, api)
}