helpers

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbsPath added in v1.0.0

func AbsPath(path string) string

func CreateTmpFile

func CreateTmpFile(contents string) (string, error)

CreateTmpFile creates a temporary file on the disk with the given contents and returns the path to it and an error if something goes wrong.

func ExecToSuccessWithTimeout

func ExecToSuccessWithTimeout(funk ExternalFuncWithString, log logr.Logger, timeout, interval time.Duration) (string, error)

ExecToSuccessWithTimeout retries the given function with string & error return, until it either succeeds of the timeout is reached. It retries every "interval" duration.

func Retryable added in v0.0.28

func Retryable(msg string) bool

func RetryableCode added in v0.1.2

func RetryableCode(code int) bool

func RunToSuccessWithTimeout

func RunToSuccessWithTimeout(funk ExternalFunc, timeout, interval time.Duration) error

RunToSuccessWithTimeout retries the given function with error return, until it either succeeds or the timeout is reached. It retries every "interval" duration.

func Tar added in v0.1.1

func Tar(dir string) (string, string, error)

func UniqueStrings added in v0.9.0

func UniqueStrings(stringSlice []string) []string

UniqueStrings process the string slice and returns a slice where duplicate strings are removed. The order of strings is not touched. It does not assume a specific order.

func WaitForCommandCompletion

func WaitForCommandCompletion(ui *termui.UI, message string, funk ExternalFuncWithString) (string, error)

WaitForCommandCompletion prints progress dots until the func completes

Types

type ExternalFunc

type ExternalFunc func() (err error)

type ExternalFuncWithString

type ExternalFuncWithString func() (output string, err error)

Directories

Path Synopsis
Package authtoken creates JWT tokens to secure the websockets connections
Package authtoken creates JWT tokens to secure the websockets connections
Package bytes is a helper to convert bytes to a human readable string
Package bytes is a helper to convert bytes to a human readable string
tailer
tailer manages objects which tail the logs of a collection of pods specified by a label selector.
tailer manages objects which tail the logs of a collection of pods specified by a label selector.
Package randstr provides functions for the generation of random strings.
Package randstr provides functions for the generation of random strings.
Package routes implements registered urls and parameter substitution
Package routes implements registered urls and parameter substitution
Package tracelog provides a logger for debugging and tracing This logger will not print anything, unless TRACE_LEVEL is at least 1
Package tracelog provides a logger for debugging and tracing This logger will not print anything, unless TRACE_LEVEL is at least 1

Jump to

Keyboard shortcuts

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