telegoapi

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMaxRetryAttempts = errors.New("max retry attempts reached")

ErrMaxRetryAttempts returned when max retry attempts reached

Functions

This section is empty.

Types

type RetryRateLimitCaller

type RetryRateLimitCaller struct {
	// Underling caller
	Caller telegoapi.Caller
	// Max number of attempts to make a call
	MaxAttempts int
	// Exponent base for delay
	ExponentBase float64
	// Starting delay duration
	StartDelay time.Duration
	// Maximum delay duration
	MaxDelay time.Duration
	// Rate limit behavior
	RateLimit telegoapi.RetryRateLimit
	// Buffer request data, if set to true requests that usually stream body using io.Reader will be buffered
	// to support retrying such requests
	//
	// Warning: Enabling this may lead to excessive memory consumption and OOMKill
	BufferRequestData bool
}

RetryRateLimitCaller decorator over [Caller] that provides retries with exponential backoff on rate limit errors Depending on [RetryRateLimit] will wait for rate limit timeout to reset or abort, defaults to do nothing Delay = min((ExponentBase ^ AttemptNumber) * StartDelay, MaxDelay)

func (*RetryRateLimitCaller) Call

func (r *RetryRateLimitCaller) Call(ctx context.Context, url string, data *telegoapi.RequestData) (response *telegoapi.Response, err error)

Call makes calls using provided caller with retries

Jump to

Keyboard shortcuts

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