Pkg
Retry

Retry

Explore the following sections to learn more:

retry

import "github.com/gemini-oss/rego/pkg/common/retry"

pkg/common/retry/retry.go

Index

Constants

const (
    MaxRetries = 5
    MinBackoff = 500
    MaxBackoff = 3000
)

func BackoffWithJitter

func BackoffWithJitter(retryCount int) time.Duration

BackoffWithJitter returns a duration for exponential backoff with jitter using a secure random source

func Retry

func Retry(operation func() error, shouldRetry func(error) bool, time Time) error

Retry retries the given operation up to MaxRetries times, with exponential backoff and jitter

type RealTime

type RealTime struct{}

func (RealTime) Sleep

func (RealTime) Sleep(duration time.Duration)

type Time

type Time interface {
    Sleep(duration time.Duration)
}

Generated by gomarkdoc