sigintTrap

package
v0.0.0-...-3f8eaf4 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package sigintTrap allows us to control when the user can press control+C

Index

Constants

This section is empty.

Variables

View Source
var TrapMessage = colors.Yellow + "Ctrl+C. Finishing..." + colors.Off

Functions

func Disable

func Disable(channel chan os.Signal)

func Enable

func Enable(ctx context.Context, cancel context.CancelFunc, cleanUp CleanupFunction) chan os.Signal

Enable enables the trap, by blocking control-C. It returns a channel that will get a value when user presses ctrl-C.

Types

type CleanupFunction

type CleanupFunction func()

Jump to

Keyboard shortcuts

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