utils

package
v0.0.0-...-ed95441 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithRetryBackoff

func WithRetryBackoff(ctx context.Context, maxRetryTimes uint, firstDuration time.Duration, f func(uint) bool)

WithRetryBackoff provides a general retry logic.

The given f will keep running, until: - f returns true. It means work is done. - retry times is greater than the given times - ctx is done.

Otherwise, this function will wait a time of the given duration in a backoff way, and continue to execute f.

The argument provided for f is the retried times.

Types

type Component

type Component struct {
	Kind ComponentKind
	Addr string // host:port
}

func (Component) String

func (c Component) String() string

type ComponentKind

type ComponentKind string
const (
	ComponentTiDB ComponentKind = "tidb"
	ComponentTiKV ComponentKind = "tikv"
)

Jump to

Keyboard shortcuts

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