signals

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package signals contains signals utilities which cannot be imported by windows.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ShutdownSignals signals used to terminate the programs.
	ShutdownSignals = []syscall.Signal{syscall.SIGINT, syscall.SIGTERM, syscall.SIGKILL}
)

Functions

func NotifyContextPosix

func NotifyContextPosix(ctx context.Context, signals ...syscall.Signal) (context.Context, context.CancelFunc)

NotifyContextPosix returns a context that is canceled when one of the given POSIX signals is received. Like os/signal.NotifyContext, but for POSIX signals.

func NotifyPosix

func NotifyPosix(c chan<- os.Signal, signals ...syscall.Signal)

NotifyPosix returns a channel that receives POSIX signals. Like os/signal.Notify, but for POSIX signals.

func Shutdown

func Shutdown() error

Shutdown is a function that can be used to terminate the program.

Types

This section is empty.

Jump to

Keyboard shortcuts

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