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 MultipartRequestConstructor ¶ added in v1.15.2
type MultipartRequestConstructor struct{}
MultipartRequestConstructor creates a streaming multipart body without an io.Pipe producer goroutine. File data remains in the original readers and is consumed only as the HTTP client reads the request body.
func (MultipartRequestConstructor) JSONRequest ¶ added in v1.15.2
func (MultipartRequestConstructor) JSONRequest(parameters any) (*ta.RequestData, error)
func (MultipartRequestConstructor) MultipartRequest ¶ added in v1.15.2
func (MultipartRequestConstructor) MultipartRequest( parameters map[string]string, filesParameters map[string]ta.NamedReader, ) (*ta.RequestData, error)
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)
Click to show internal directories.
Click to hide internal directories.