Back to godoc.org
google.golang.org/api/transport/grpc

package grpc

v0.26.0
Latest Go to latest
Published: 5 days ago | License: BSD-3-Clause | Module: google.golang.org/api

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

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.

func WithConnPool

func WithConnPool(p ConnPool) option.ClientOption

WithConnPool returns a ClientOption that specifies the ConnPool connection to use as the basis of communications.

This is only to be used by Google client libraries internally, for example when creating a longrunning API client that shares the same connection pool as a service client.

type ConnPool

type ConnPool = internal.ConnPool // NOTE(cbro): type alias to export the type. It must live in internal to avoid a circular dependency.

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.

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
f or F : Jump to identifier