shutdown

package module
v0.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OnShutdown

func OnShutdown(hook func())

OnShutdown registers a hook shutdown function and hangs until the programs is shutdown by an os interrupt signal.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL