run

package
v0.0.0-...-71c6276 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2023 License: GPL-3.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LogFatalHandler func(format string, v ...interface{}) = func(format string, v ...interface{}) {
	log.Fatalf(format, v...)
}

LogFatalHandler can be overridden if needed

Functions

func CatchInterruptSignal

func CatchInterruptSignal(handler func())

CatchInterruptSignal listens for external interrupt signals, if happens, runs a handler

func HandlePanic

func HandlePanic(message string, messageHandler func(message string))

HandlePanic recovers from panic and prints the message

func IfErrorThenExit

func IfErrorThenExit(err error, message string, logHandlers ...func(format string, v ...interface{}))

IfErrorThenExit checks if error is not nil, prints message and exit

func Periodic

func Periodic(freq time.Duration, startNow bool, handler func()) (cancel func())

Periodic runs handler in a frequency defined by the parameters. Returns cancel function

func StartSameTime

func StartSameTime(runners ...func())

StartSameTime runs provided runners at the same time (or as close as possible)

Types

This section is empty.

Jump to

Keyboard shortcuts

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