Documentation
¶
Index ¶
- Constants
- Variables
- func ByteCountSI(b int64) string
- func Contains(v string, l []string) bool
- func ContainsList(v []string, l []string) bool
- func DirExists(path string) (bool, error)
- func DirSize(path string) (int64, error)
- func FileExists(filename string) (bool, error)
- func GetTxtFunc() map[string]any
- func IsLabelSelectorMatch(source map[string]string, selector metav1.LabelSelector) (bool, error)
- func IsSelectorMatch(selector terraformv1alphav1.Selector, ...) (bool, error)
- func Prefix(prefix string, e interface{}) string
- func Retry(ctx context.Context, attempts int, jitter bool, minInterval time.Duration, ...) error
- func RetryWithTimeout(ctx context.Context, timeout, interval time.Duration, retryFn RetryFunc) error
- func Sleep(ctx context.Context, sleep time.Duration) bool
- func TouchFile(path string) error
- func WaitForFile(ctx context.Context, path string, timeout time.Duration) error
- func YAMLDocuments(reader io.Reader) ([]string, error)
- type RetryFunc
Constants ¶
View Source
const (
// MaxAttempts is the max attempts
MaxAttempts = 99999999
)
Variables ¶
View Source
var ( // ErrCancelled indicates the operation was cancelled ErrCancelled = errors.New("operation cancelled") // ErrReachMaxAttempts indicates we hit the limit ErrReachMaxAttempts = errors.New("reached max attempts") )
Functions ¶
func ByteCountSI ¶
ByteCountSI returns the number of bytes in the given number of SI units.
func ContainsList ¶
ContainsList checks a list has a value in it
func GetTxtFunc ¶
GetTxtFunc returns a defaults list of methods for text templating
func IsLabelSelectorMatch ¶
IsLabelSelectorMatch is used to check if the selectors matches the labels.
func IsSelectorMatch ¶
func IsSelectorMatch( selector terraformv1alphav1.Selector, resourceLabels, namespaceLabels map[string]string) (bool, error)
IsSelectorMatch is used to check if the resource matches the selectors.
func Retry ¶
func Retry(ctx context.Context, attempts int, jitter bool, minInterval time.Duration, retryFn RetryFunc) error
Retry is used to retry an operation multiple times under a context. If the retryFn returns false with no error, the operation will be retried.
func RetryWithTimeout ¶
func RetryWithTimeout(ctx context.Context, timeout, interval time.Duration, retryFn RetryFunc) error
RetryWithTimeout creates a retry with a specific timeout
func WaitForFile ¶
WaitForFile waits for a file to exist or times out
Types ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.