util

package
v0.0.139 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyWithBackoff added in v0.0.99

func ApplyWithBackoff(f func() error) error

ApplyWithBackoff tries to apply the specified function using an exponential backoff algorithm. If the function eventually succeed nil is returned, otherwise the error returned by f.

func Contains added in v0.0.99

func Contains(list []string, s string) bool

Contains checks whether the specified string is contained in the given string slice. Returns true if it does, false otherwise

func IsBool added in v0.0.118

func IsBool(value interface{}, key string) error

IsBool checks if value stored at a given key is a bool.

func IsInt added in v0.0.118

func IsInt(value interface{}, key string) error

IsInt checks if values stored at a given key is an int.

func IsNotEmpty added in v0.0.118

func IsNotEmpty(value interface{}, key string) error

IsNotEmpty checks if value stored at given key is empty. if it is empty it returns an error.

func NameOfFunction added in v0.0.118

func NameOfFunction(pc uintptr) string

NameOfFunction gives name of the current function given program counter.

Types

type MultiError added in v0.0.118

type MultiError struct {
	Errors []error
}

MultiError is a collection of errors.

func (*MultiError) Collect added in v0.0.118

func (m *MultiError) Collect(err error)

Collect appends an error to this MultiError.

func (*MultiError) Empty added in v0.0.118

func (m *MultiError) Empty() bool

Empty returns true if current MuiltiError is empty, false otherwise.

func (MultiError) ToError added in v0.0.118

func (m MultiError) ToError() error

ToError returns a single error made up of all errors in this MultiError.

Jump to

Keyboard shortcuts

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