svc

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2019 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MaxRetries = 10

MaxRetries is the maximum number of retries before bailing.

Functions

func IsMaxRetries

func IsMaxRetries(err error) bool

IsMaxRetries checks whether the error is due to hitting the maximum number of retries or not.

func Mask

func Mask(data string) string

Mask replaces every other char of a string with an *.

func MustGetEnv

func MustGetEnv(variable string) string

MustGetEnv retrieves the provided environment variable value, and panics if not found.

func MustGetEnvs

func MustGetEnvs(variables ...string) []string

MustGetEnvs retrieves the provided environment variables values, and panics if any is not found.

func RandString

func RandString(n int) string

func Try

func Try(fn Func) error

Try keeps trying the function until the second argument returns false, or no error is returned.

Types

type Func

type Func func(attempt int) (retry bool, err error)

Func represents functions that can be retried.

Jump to

Keyboard shortcuts

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