Documentation ¶
Index ¶
- Constants
- func Coalesce(strArgs ...string) string
- func Die(lastWord interface{})
- func DieIfError(err error, message string)
- func MustURLParse(urlStr string) *url.URL
- func MustValidate(val interface{})
- func RandString(size int, set int, include string, exclude string) (string, error)
- func RandStringInit()
- func RepeatMethod(ctx context.Context, backoff BackoffFunc, maxAttempts int, ...) (err error)
- func WrapPanic(method func(ctx context.Context)) func(ctx context.Context) error
- type BackoffFunc
Constants ¶
View Source
const GenRandAll = GenRandLowerUpperDigit | GenRandSymbol
GenRandAll .
View Source
const GenRandDigit = 1 << 2
GenRandDigit .
View Source
const GenRandLower = 1 << 0
GenRandLower .
View Source
const GenRandLowerDigit = GenRandLower | GenRandDigit
GenRandLowerDigit .
View Source
const GenRandLowerUpper = GenRandLower | GenRandUpper
GenRandLowerUpper .
View Source
const GenRandLowerUpperDigit = GenRandLowerUpper | GenRandDigit
GenRandLowerUpperDigit .
View Source
const GenRandNone = 0
GenRandNone .
View Source
const GenRandSymbol = 1 << 3
GenRandSymbol .
View Source
const GenRandUpper = 1 << 1
GenRandUpper .
View Source
const GenRandUpperDigit = GenRandUpper | GenRandDigit
GenRandUpperDigit .
Variables ¶
This section is empty.
Functions ¶
func DieIfError ¶
DieIfError if error is not empty wrap it in message, print and stop process
func RandString ¶
RandString .
func RepeatMethod ¶
func RepeatMethod(ctx context.Context, backoff BackoffFunc, maxAttempts int, callback func(context.Context) error) (err error)
RepeatMethod for max attempts and wait interval before them in sync mode
Types ¶
type BackoffFunc ¶
BackoffFunc method
func BackoffExponential ¶
func BackoffExponential(waitInterval time.Duration, multiply float64) BackoffFunc
BackoffExponential waits exponential time
func BackoffLinear ¶
func BackoffLinear(waitInterval time.Duration) BackoffFunc
BackoffLinear waits linear time
Click to show internal directories.
Click to hide internal directories.