os

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandUserPath

func ExpandUserPath(path string) (expandedPath string, err error)

ExpandUserPath expands the specified user home relative path to an absolute path. Supports '~', '$HOME' for Unix based environments and '%userprofile%' '%homepath%' for windows. If the provided path has no home dir prefix the path returns as is. Relative paths are not expanded.

func RegisterShutdownHook

func RegisterShutdownHook(hook HookFn)

RegisterShutdownHook registers a hook for system call signals SIGTERM and SIGKILL

Types

type HookFn

type HookFn = func(os.Signal)

HookFn a signal handler

func NewSignalHook

func NewSignalHook(filter os.Signal, f func()) HookFn

NewSignalHook returns a hook that only invokes the specified function if the received signal matches the specified one. Supported signals are SIGTERM and SIGKILL

Jump to

Keyboard shortcuts

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