xos

package
v0.0.0-...-f89cf20 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package xos implements operating system-related utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnvBool

func EnvBool(key string) (bool, error)

func EnvInt64

func EnvInt64(key string) (int64, error)

func EnvInt64s

func EnvInt64s(key string) ([]int64, error)

func EnvString

func EnvString(key string) (string, error)

func EnvStrings

func EnvStrings(key string) ([]string, error)

func Exit

func Exit(code int)

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

func HandleInterrupts

func HandleInterrupts(l *log.Logger)

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

func Hostname

func Hostname() string

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.

Jump to

Keyboard shortcuts

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