signals

package
Version: v0.0.0-...-bcfd9a2 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2022 License: Apache-2.0 Imports: 4 Imported by: 17

Documentation

Overview

Package signals makes it easier to catch SIGTERM.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleInterrupt

func HandleInterrupt(fn func()) (stopper func())

HandleInterrupt calls 'fn' in a separate goroutine on SIGTERM or Ctrl+C.

When SIGTERM or Ctrl+C comes for a second time, logs to stderr and kills the process immediately via os.Exit(1).

Returns a callback that can be used to remove the installed signal handlers.

func Interrupts

func Interrupts() []os.Signal

Interrupts returns signals to interpret as interrupts.

Types

This section is empty.

Jump to

Keyboard shortcuts

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