signal

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

README

signal

The signal package implements helpers for signal handling in Go.

package main

func main() {
	ctx := signal.WithSignal(ctx)
	<-ctx.Done()
}

Documentation

Overview

Package signal offers a utility for handling signal interrupts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithSignal

func WithSignal(parent context.Context) (context.Context, context.CancelFunc)

WithSignal returns a cancelable context which ends on signal interrupt.

The first interrupt cancels the context, allowing callers to terminate gracefully. Upon receiving a second interrupt the process is terminated with exit code 130 (128 + SIGINT)

Types

This section is empty.

Jump to

Keyboard shortcuts

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