Documentation
¶
Index ¶
- Variables
- func Interceptor(callOpts ...grpc.CallOption) grpc.UnaryClientInterceptordeprecated
- func WithAttemptHeader(enable bool) grpc.CallOptiondeprecated
- func WithBackoff(f BackoffFunc) grpc.CallOptiondeprecated
- func WithCodes(codes ...codes.Code) grpc.CallOptiondeprecated
- func WithDefaultInterceptor() grpc.DialOptiondeprecated
- func WithMax(maxRetryCount int) grpc.CallOptiondeprecated
- func WithPerCallTimeout(to time.Duration) grpc.CallOptiondeprecated
- type BackoffFunc
- func BackoffExponentialWithJitter(base time.Duration, cap time.Duration) BackoffFunc
- func BackoffLinearWithJitter(waitBetween time.Duration, jitterFraction float64) BackoffFunc
- func DefaultBackoff() BackoffFuncdeprecated
- func DefaultExponentialJitterBackoff() BackoffFuncdeprecated
- func DefaultLinearJitterBackoff() BackoffFuncdeprecated
Constants ¶
This section is empty.
Variables ¶
var ( // TODO(seukyaso): Consider adding some non-zero default retry options DefaultRetriableCodes = []codes.Code{codes.ResourceExhausted, codes.Unavailable} )
Functions ¶
func Interceptor
deprecated
func Interceptor(callOpts ...grpc.CallOption) grpc.UnaryClientInterceptor
Interceptor returns retry interceptor, that can be parametrized by specific call options. Without any option, it uses default options, that basically retries nothing. Default retry quantity is 0, backoff function is nil, retry codes are DefaultRetriableCodes, AttemptHeader is false, and perCallTimeout is 0.
Deprecated: RetryDialOption function to provide standard gRPC retries. For idempotency keys use idempotency.Interceptor
func WithAttemptHeader
deprecated
func WithAttemptHeader(enable bool) grpc.CallOption
WithAttemptHeader adds retry attempt number to context outgoing metadata, with key "x-retry-attempt".
Deprecated: use retry/v1 package instead of this options
func WithBackoff
deprecated
func WithBackoff(f BackoffFunc) grpc.CallOption
WithBackoff sets up interceptor with custom defined backoff function
Deprecated: use retry/v1 package instead of this options
func WithCodes
deprecated
func WithCodes(codes ...codes.Code) grpc.CallOption
WithCodes overrides the whole retriable codes list.
Deprecated: use retry/v1 package instead of this options
func WithDefaultInterceptor
deprecated
func WithDefaultInterceptor() grpc.DialOption
WithDefaultInterceptor returns interceptor that DOESN'T retrу anything. Its possible to change its behaviour with call options.
Deprecated: use retry/v1 package instead of this options
func WithMax
deprecated
func WithMax(maxRetryCount int) grpc.CallOption
WithMax option sets quantity of retry attempts. It handles negative maxRetryCount as INFINITE retries.
Deprecated: use retry/v1 package instead of this options
func WithPerCallTimeout
deprecated
func WithPerCallTimeout(to time.Duration) grpc.CallOption
WithPerCallTimeout adds timeout for retry calls.
Deprecated: use retry/v1 package instead of this options
Types ¶
type BackoffFunc ¶
func BackoffExponentialWithJitter ¶
func BackoffExponentialWithJitter(base time.Duration, cap time.Duration) BackoffFunc
func BackoffLinearWithJitter ¶
func BackoffLinearWithJitter(waitBetween time.Duration, jitterFraction float64) BackoffFunc
func DefaultBackoff
deprecated
func DefaultBackoff() BackoffFunc
DefaultBackoff uses exponential backoff with jitter, with base = 50ms, and maximum timeout = 1 minute.
Deprecated: use retry/v1 package instead of this options
func DefaultExponentialJitterBackoff
deprecated
func DefaultExponentialJitterBackoff() BackoffFunc
WithDefaultExponentialJitterBackoff same as WithDefaultBackoff
Deprecated: use retry/v1 package instead of this options
func DefaultLinearJitterBackoff
deprecated
func DefaultLinearJitterBackoff() BackoffFunc
DefaultLinearJitterBackoff uses linear backoff with base = 50ms, and jitter = +-10%
Deprecated: use retry/v1 package instead of this options