grpcutils

package
v0.25.1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: Apache-2.0 Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithResetConnectionBackoffStream

func WithResetConnectionBackoffStream() grpc.StreamClientInterceptor

WithResetConnectionBackoffStream creates a Stream Interceptor which resets the underlying connection's retry backoff timer. This allows grpc connections to quickly attempt to reconnect to a server e.g. after a server restart.

func WithResetConnectionBackoffUnary

func WithResetConnectionBackoffUnary() grpc.UnaryClientInterceptor

WithResetConnectionBackoffUnary creates a Unary Interceptor which resets the underlying connection's retry backoff timer. This allows grpc connections to quickly attempt to reconnect to a server e.g. after a server restart.

Types

type DialOpts

type DialOpts struct {
	// address of the gRPC server
	Address string

	// connect over plaintext or HTTPS
	Insecure bool

	// Enable fast reconnection attempts on network failures (gRPC code 14 'unavailable')
	ReconnectOnNetworkFailures bool

	// Set this as the authority (host header) on the outbound dial request
	Authority string

	// additional options the caller wishes to inject
	ExtraOptions []grpc.DialOption

	// duration to wait for a connection to be established. if zero, defaults to 1 minute
	Timeout time.Duration
}

DialOpts provides a common set of options for initiating connections to a gRPC server.

func (DialOpts) Dial

func (o DialOpts) Dial(ctx context.Context) (*grpc.ClientConn, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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