grpc

package
v0.15.1-0...-796286a Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2020 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Overview

Package grpc supports network connections to GRPC servers. This package is not intended for use by end developers. Use the google.golang.org/api/option package to configure API clients.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(ctx context.Context, opts ...option.ClientOption) (*grpc.ClientConn, error)

Dial returns a GRPC connection for use communicating with a Google cloud service, configured with the given ClientOptions.

func DialInsecure

func DialInsecure(ctx context.Context, opts ...option.ClientOption) (*grpc.ClientConn, error)

DialInsecure returns an insecure GRPC connection for use communicating with fake or mock Google cloud service implementations, such as emulators. The connection is configured with the given ClientOptions.

Types

type ConnPool

type ConnPool interface {
	// Conn returns a ClientConn from the pool.
	//
	// Conns aren't returned to the pool.
	Conn() *grpc.ClientConn

	// Close closes every ClientConn in the group.
	//
	// The error returned by Close may be a single error or multiple errors.
	Close() error
}

ConnPool is a pool of grpc.ClientConns.

func DialPool

func DialPool(ctx context.Context, opts ...option.ClientOption) (ConnPool, error)

DialPool returns a pool of GRPC connections for the given service. This differs from the connection pooling implementation used by Dial, which uses a custom GRPC load balancer. DialPool should be used instead of Dial when a pool is used by default or a different custom GRPC load balancer is needed. The context and options are shared between each Conn in the pool. The pool size is configured using the WithGRPCConnectionPool option.

This API is subject to change as we further refine requirements. It will go away if gRPC stubs accept an interface instead of the concrete ClientConn type. See https://github.com/grpc/grpc-go/issues/1287.

Jump to

Keyboard shortcuts

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