kubernetes/vendor/go.etcd.io/etcd/client/v3/retry_interceptor.go

// unaryClientInterceptor returns a new retrying unary client interceptor.
//
// The default configuration of the interceptor is to not retry *at all*. This behaviour can be
// changed through options (e.g. WithMax) on creation of the interceptor or on call (through grpc.CallOptions).
func (c *Client) unaryClientInterceptor(optFuncs ...retryOption) grpc.UnaryClientInterceptor {}

// streamClientInterceptor returns a new retrying stream client interceptor for server side streaming calls.
//
// The default configuration of the interceptor is to not retry *at all*. This behaviour can be
// changed through options (e.g. WithMax) on creation of the interceptor or on call (through grpc.CallOptions).
//
// Retry logic is available *only for ServerStreams*, i.e. 1:n streams, as the internal logic needs
// to buffer the messages sent by the client. If retry is enabled on any other streams (ClientStreams,
// BidiStreams), the retry interceptor will fail the call.
func (c *Client) streamClientInterceptor(optFuncs ...retryOption) grpc.StreamClientInterceptor {}

// shouldRefreshToken checks whether there's a need to refresh the token based on the error and callOptions,
// and returns a boolean value.
func (c *Client) shouldRefreshToken(err error, callOpts *options) bool {}

func (c *Client) refreshToken(ctx context.Context) error {}

type serverStreamingRetryingStream

func (s *serverStreamingRetryingStream) setStream(clientStream grpc.ClientStream) {}

func (s *serverStreamingRetryingStream) getStream() grpc.ClientStream {}

func (s *serverStreamingRetryingStream) SendMsg(m interface{}

func (s *serverStreamingRetryingStream) CloseSend() error {}

func (s *serverStreamingRetryingStream) Header() (metadata.MD, error) {}

func (s *serverStreamingRetryingStream) Trailer() metadata.MD {}

func (s *serverStreamingRetryingStream) RecvMsg(m interface{}

func (s *serverStreamingRetryingStream) receiveMsgAndIndicateRetry(m interface{}

func (s *serverStreamingRetryingStream) reestablishStreamAndResendBuffer(callCtx context.Context) (grpc.ClientStream, error) {}

func waitRetryBackoff(ctx context.Context, attempt uint, callOpts *options) error {}

// isSafeRetry returns "true", if request is safe for retry with the given error.
func isSafeRetry(c *Client, err error, callOpts *options) bool {}

func isContextError(err error) bool {}

func contextErrToGrpcErr(err error) error {}

var defaultOptions

type backoffFunc

// withRetryPolicy sets the retry policy of this call.
func withRetryPolicy(rp retryPolicy) retryOption {}

// withMax sets the maximum number of retries on this call, or this interceptor.
func withMax(maxRetries uint) retryOption {}

// WithBackoff sets the `BackoffFunc `used to control time between retries.
func withBackoff(bf backoffFunc) retryOption {}

type options

type retryOption

func reuseOrNewWithCallOptions(opt *options, retryOptions []retryOption) *options {}

func filterCallOptions(callOptions []grpc.CallOption) (grpcOptions []grpc.CallOption, retryOptions []retryOption) {}

// BackoffLinearWithJitter waits a set period of time, allowing for jitter (fractional adjustment).
//
// For example waitBetween=1s and jitter=0.10 can generate waits between 900ms and 1100ms.
func backoffLinearWithJitter(waitBetween time.Duration, jitterFraction float64) backoffFunc {}