osutil

package
v3.0.0-...-eac99ac Latest Latest
Warning

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

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

Documentation

Overview

Package osutil implements operating system-related utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exit

func Exit(code int)

Exit relays to os.Exit if no interrupt handlers are running, blocks otherwise.

func HandleInterrupts

func HandleInterrupts(lg *zap.Logger)

HandleInterrupts calls the handler functions on receiving a SIGINT or SIGTERM.

func RegisterInterruptHandler

func RegisterInterruptHandler(h InterruptHandler)

RegisterInterruptHandler registers a new InterruptHandler. Handlers registered after interrupt handing was initiated will not be executed.

func Unsetenv

func Unsetenv(key string) error

Types

type InterruptHandler

type InterruptHandler func()

InterruptHandler is a function that is called on receiving a SIGTERM or SIGINT signal.

Jump to

Keyboard shortcuts

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