package
module
Version:
v0.0.0
Opens a new window with list of versions in this module.
Published: May 27, 2020
License: Apache-2.0
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
shutdown
A Go module for executing a behaviour when application is shutdown.
package main
import (
"fmt"
"github.com/agusmunioz/shutdown"
)
func main() {
shutdownHook := func() {
fmt.Println("Graceful shutdown")
}
shutdown.OnShutdown(shutdownHook)
}
Documentation
¶
func OnShutdown(hook func())
OnShutdown registers a hook shutdown function and hangs until the programs is shutdown by an os interrupt signal.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.