retry

package
v0.0.0-...-dcaea88 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Attempt

func Attempt(t test.TestHelper, f func(t test.TestHelper)) *test.RetryTestHelper

Attempt runs the given function, captures any errors thrown by the function, and returns a RetryTestHelper, which you can use to: - check if the attempt failed by invoking retryTestHelper.Failed() - print everything that the function logged by invoking retryTestHelper.FlushLogBuffer()

func UntilSuccess

func UntilSuccess(t test.TestHelper, f func(t test.TestHelper))

func UntilSuccessWithOptions

func UntilSuccessWithOptions(t test.TestHelper, options RetryOptions, f func(t test.TestHelper))

Types

type RetryOptions

type RetryOptions struct {
	// contains filtered or unexported fields
}

func Options

func Options() RetryOptions

func (RetryOptions) DelayBetweenAttempts

func (o RetryOptions) DelayBetweenAttempts(delay time.Duration) RetryOptions

func (RetryOptions) LogAttempts

func (o RetryOptions) LogAttempts(logAttempts bool) RetryOptions

func (RetryOptions) MaxAttempts

func (o RetryOptions) MaxAttempts(maxAttempts int) RetryOptions

Jump to

Keyboard shortcuts

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