Involved Source Files
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.
pool.go
Package-Level Type Names (total 6, in which 1 are exported)
/* sort exporteds by: | */
ConnPool is a pool of grpc.ClientConns.
ConnPoolConnPool( T) Apply(s *internal.DialSettings)
Close closes every ClientConn in the pool.
The error returned by Close may be a single error or multiple errors.
Conn returns a ClientConn from the pool.
Conns aren't returned to the pool.
Invoke performs a unary RPC and returns after the response is received
into reply.
NewStream begins a streaming RPC.
Num returns the number of connections in the pool.
It will always return the same value.
T : google.golang.org/api/internal.ConnPool
T : google.golang.org/api/option.ClientOption
T : google.golang.org/grpc.ClientConnInterface
T : io.Closer
grpcTokenSource supplies PerRPCCredentials from an oauth.TokenSource.
TokenSourceoauth.TokenSource
Additional metadata attached as headers.
requestReasonstring
GetRequestMetadata gets the request metadata as a map from a grpcTokenSource.
RequireTransportSecurity indicates whether the credentials requires transport security.
Token returns a token or an error.
Token must be safe for concurrent use by multiple goroutines.
The returned Token must not be modified.
T : google.golang.org/grpc/credentials.PerRPCCredentials
T : golang.org/x/oauth2.TokenSource
multiError represents errors from multiple conns in the group.
TODO: figure out how and whether this is useful to export. End users should
not be depending on the transport/grpc package directly, so there might need
to be some service-specific multi-error type.
( T) Error() string
T : error
Package-Level Functions (total 10, in which 4 are exported)
Dial returns a GRPC connection for use communicating with a Google cloud
service, configured with the given ClientOptions.
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.
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.
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.
generateDefaultMtlsEndpoint attempts to derive the mTLS version of the
defaultEndpoint via regex, and returns defaultEndpoint if unsuccessful.
We need to applying the following 2 transformations:
1. pubsub.googleapis.com to pubsub.mtls.googleapis.com
2. pubsub.sandbox.googleapis.com to pubsub.mtls.sandbox.googleapis.com
TODO(cbro): In the future, the mTLS endpoint will be read from Service Config
and passed in as defaultMtlsEndpoint instead of generated from defaultEndpoint,
and this function will be removed.
Package-Level Variables (total 2, neither is exported)
Set at init time by dial_appengine.go. If nil, we're not on App Engine.
Set at init time by dial_socketopt.go. If nil, socketopt is not supported.
The pages are generated with Goldsv0.3.2-preview. (GOOS=darwin GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.