Skip to content

MatthewLavine/gracefulshutdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gracefulshutdown

Go

gracefulshutdown is a Go library that allows applications to register shutdown handlers to be executed during server shutdown.

Usage

Register a shutdown handler:

gracefulshutdown.AddShutdownHandler(func() error {
    log.Println("Shutting down server")
    return httpServer.Shutdown(ctx)
})

See example/example.go for a full working example.