Documentation
¶
Overview ¶
Package xos implements operating system-related utility functions.
Index ¶
- func EnvBool(key string) (bool, error)
- func EnvInt64(key string) (int64, error)
- func EnvInt64s(key string) ([]int64, error)
- func EnvString(key string) (string, error)
- func EnvStrings(key string) ([]string, error)
- func Exit(code int)
- func HandleInterrupts(l *log.Logger)
- func Hostname() string
- func RegisterInterruptHandler(h InterruptHandler)
- type InterruptHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnvStrings ¶
func Exit ¶
func Exit(code int)
Exit relays to os.Exit if no interrupt handlers are running, blocks otherwise.
func HandleInterrupts ¶
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.
Types ¶
type InterruptHandler ¶
type InterruptHandler func()
InterruptHandler is a function that is called on receiving a SIGTERM or SIGINT signal.
Click to show internal directories.
Click to hide internal directories.