grpc

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package grpc provides gRPC client utilities.

Index

Constants

View Source
const (
	// DialTimeout is the default gRPC dial timeout in seconds.
	DialTimeout = 30

	// PingTime is the default gRPC keep-alive ping time internal in seconds. This corresponds to the minimum ping wait
	// time on the server side. Ref.: https://pkg.go.dev/google.golang.org/grpc/keepalive#EnforcementPolicy
	PingTime = 300

	// PingTimeout is the default gRPC keep-alive ping timeout in seconds.
	PingTimeout = 30

	// UnaryTimeout is the default unary RPC timeout in seconds.
	UnaryTimeout = 30
)

Variables

This section is empty.

Functions

func ConnectToEndpoint

func ConnectToEndpoint(ctxopts ...ContextOpts) (*grpc.ClientConn, error)

ConnectToEndpoint attempts to connect to the provided endpoint. If endpoint is empty, it picks up the endpoint from the current auth ctx.

func ConnectToEndpointOrExit

func ConnectToEndpointOrExit(ctxopts ...ContextOpts) *grpc.ClientConn

ConnectToEndpointOrExit returns a client connection to the provided endpoint. If it encounters an error, it exits.

Types

type ContextOpts

type ContextOpts func(context.Context) context.Context

ContextOpts for the context.

Jump to

Keyboard shortcuts

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