signals

package
v0.1.30 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExitCode int

ExitCode is a global variable that is intended to be used by CLI commands to hold the current exit code and subsequently used in ExitWithCodeIfNonZero.

Functions

func ExitWithCodeIfNonZero added in v0.1.2

func ExitWithCodeIfNonZero(_ *cobra.Command, _ []string)

ExitWithCodeIfNonZero is a helper function that is intended to be used as a PostRun function for a cobra command. It checks if the exitCode variable is non-zero and exits the program with the global ExitCode value.

func GoOnExitSignal

func GoOnExitSignal(logger polylog.Logger, onInterrupt func())

GoOnExitSignal calls the given callback when the process receives an interrupt or terminate signal. It sets up a goroutine that listens for OS signals and invokes the callback

Types

This section is empty.

Jump to

Keyboard shortcuts

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