exit

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: May 8, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package exit allows to register callbacks which are called on program exit.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exit added in v1.2.1

func Exit(code int)

Exit terminates the application via os.Exit but waits for all exit handlers to complete before calling os.Exit.

func Fatal added in v1.2.1

func Fatal(v ...interface{})

Fatal is a replacement for log.Fatal which will trigger the closure of all registered exit handlers and waits for their completion and then call os.Exit(1).

func Fatalf added in v1.2.1

func Fatalf(format string, v ...interface{})

Fatalf is a replacement for log.Fatalf and behaves like Fatal.

func Listen

func Listen(fn func(os.Signal))

Listen registers an exit handler which is called on SIGINT/SIGKILL/SIGTERM or when Exit/Fatal/Fatalf is called.

func Wait added in v1.2.1

func Wait()

Wait waits for all exit handlers to complete.

Types

This section is empty.

Jump to

Keyboard shortcuts

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