retry

package
v0.7.21 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2021 License: Apache-2.0 Imports: 10 Imported by: 26

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RetryingStreamClientInterceptor

func RetryingStreamClientInterceptor(callOpts ...CallOption) func(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error)

RetryingStreamClientInterceptor returns a ClientStreamInterceptor that retries both requests and responses

func RetryingUnaryClientInterceptor

func RetryingUnaryClientInterceptor(callOpts ...CallOption) func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error

RetryingUnaryClientInterceptor returns a UnaryClientInterceptor that retries requests

Types

type CallOption

type CallOption struct {
	grpc.EmptyCallOption // make sure we implement private after() and before() fields so we don't panic.
	// contains filtered or unexported fields
}

CallOption is a retrying interceptor call option

func WithInterval

func WithInterval(d time.Duration) CallOption

WithInterval sets the base retry interval

func WithMaxInterval

func WithMaxInterval(d time.Duration) CallOption

WithMaxInterval sets the maximum retry interval

func WithPerCallTimeout

func WithPerCallTimeout(t time.Duration) CallOption

WithPerCallTimeout sets the per-call retry timeout

func WithRetryOn

func WithRetryOn(codes ...codes.Code) CallOption

WithRetryOn sets the codes on which to retry a request

Jump to

Keyboard shortcuts

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