util

package
v1.0.0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2018 License: Apache-2.0 Imports: 5 Imported by: 12

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckErr

func CheckErr(err error, msg string, level string)

CheckErr checks for error, logs and optionally exits the program

Example (Exit)
// fakeErr := errors.New("Fake error")
// How do we test the output and the os.Exit(1)?"
// CheckErr(fakeErr, "test: %v", "fatal")
Example (Nil)
CheckErr(nil, "test", "fatal")
Example (NoExit)
fakeErr := errors.New("Fake error")
CheckErr(fakeErr, "test: %v", "error")

func GetDurationFromInterval

func GetDurationFromInterval(interval string) (duration time.Duration, err error)

GetDurationFromInterval takes a formated interval and returns a datetime

func Retry

func Retry(attempts int, callback func() error) (err error)

Retry retry on error

Types

This section is empty.

Jump to

Keyboard shortcuts

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