Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Default Validators is a set of functions that validate errors that should trigger a retry of the request. DefaultValidators = []Validator{ Validator(errors.IsResourceExhausted), Validator(errors.IsUnavailable), } )
Functions ¶
func UnaryClientInterceptor ¶
func UnaryClientInterceptor(opts ...Option) grpc.UnaryClientInterceptor
UnaryClientInterceptor returns a new unary client interceptor that retries the execution of external gRPC calls, the retry attempt will only occur if any of the validators define the error as a trigger.
Types ¶
type Option ¶
type Option func(*options)
Options is an option for the rpcretry clients.
func UseMetadata ¶
UseMetadata establishes if the x-rate-limit headers will be used to dinamically calculate the timeout between requests.
func WithDefaultTimeout ¶
WithDefaultTimeout sets the default timeout between request retries.
func WithJitter ¶
WithJitter determines the value of the fraciton used to create the deviation in the timeout between the requests.
func WithValidator ¶
WithValidator sets validators that will be evaluated when validating if a request should be retried.
Click to show internal directories.
Click to hide internal directories.