utils

package
v3.6.3 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func After

func After(d time.Duration) *time.Time

After returns pointer to time after specific duration

func ExpandEnv

func ExpandEnv(
	args map[string]interface{},
	flag string,
	allowEmpty bool,
) string

func ExpandEnvUUID

func ExpandEnvUUID(
	args map[string]interface{},
	flag string,
) uuid.UUID

func GetSanitizedArgs

func GetSanitizedArgs() []string

func MustParseDuration

func MustParseDuration(args map[string]interface{}, flag string) time.Duration

func MustParseInt

func MustParseInt(args map[string]interface{}, flag string) int

func Transcode

func Transcode(
	u interface{},
	v interface{},
) error

func TruncateString

func TruncateString(str string, num int) string

func WithBackoff

func WithBackoff(fn func() error, backoff Backoff) error

Types

type Backoff

type Backoff struct {
	Sleep      time.Duration
	MaxRetries int
}

Jump to

Keyboard shortcuts

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