Documentation
¶
Overview ¶
Package utils supplies logging and testing utils.
Index ¶
- Variables
- func BoolPointer(b bool) *bool
- func Float32Pointer(f float32) *float32
- func Float64Pointer(f float64) *float64
- func GetJSONBytes(url string) ([]byte, error)
- func GetLogger() *logrus.Logger
- func Int32Pointer(i int32) *int32
- func SetLogLevel(l logrus.Level)
- func StringPointer(s string) *string
- func WaitTimeoutOrError(wg *sync.WaitGroup, timeout time.Duration, errCh chan error) error
- type HTTPMethod
Constants ¶
This section is empty.
Variables ¶
var CompletePath func(prefix string, suffix string) string = iter8utils.CompletePath
CompletePath determines complete path of a file
Functions ¶
func BoolPointer ¶ added in v0.1.17
BoolPointer takes a bool as input, creates a new variable with the input value, and returns a pointer to the variable
func Float32Pointer ¶ added in v0.1.16
Float32Pointer takes an float32 as input, creates a new variable with the input value, and returns a pointer to the variable
func Float64Pointer ¶ added in v0.1.16
Float64Pointer takes an float64 as input, creates a new variable with the input value, and returns a pointer to the variable
func GetJSONBytes ¶ added in v0.1.16
GetJSONBytes downloads JSON from URL and returns a byte slice
func Int32Pointer ¶ added in v0.1.16
Int32Pointer takes an int32 as input, creates a new variable with the input value, and returns a pointer to the variable
func StringPointer ¶ added in v0.1.16
StringPointer takes a string as input, creates a new variable with the input value, and returns a pointer to the variable
func WaitTimeoutOrError ¶ added in v0.1.16
WaitTimeoutOrError waits for one of the following three events 1) all goroutines in the waitgroup to finish normally -- no error is returned 2) a timeout occurred before all go routines could finish normally -- an error is returned 3) an error in the errCh channel sent by one of the goroutines -- an error is returned See https://stackoverflow.com/questions/32840687/timeout-for-waitgroup-wait
Types ¶
type HTTPMethod ¶ added in v0.1.16
type HTTPMethod string
HTTPMethod is either GET or POST
const ( // GET method GET HTTPMethod = "GET" // POST method POST = "POST" )
func HTTPMethodPointer ¶ added in v0.1.16
func HTTPMethodPointer(h HTTPMethod) *HTTPMethod
HTTPMethodPointer takes an HTTPMethod as input, creates a new variable with the input value, and returns a pointer to the variable