grpcclient

package
v0.0.26 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2020 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendOutgoingRequestID added in v0.0.2

func AppendOutgoingRequestID() grpc.UnaryClientInterceptor

AppendOutgoingRequestID reads the incoming Request-ID from the context and appends it to the outgoing context. Forwarding Request-IDs from gRPC service to service allows for request tracking across any number of services.

func Conn

func Conn(service string) *grpc.ClientConn

Conn returns the global grpc.ClientConn for the given service. If the connection has not yet been initialized, it will panic.

func Credentials

func Credentials(serverURL string, caCerts [][]byte, fullCert tls.Certificate, tlsopts ...TLSOption) (grpc.DialOption, error)

Credentials returns a gRPC DialOption configured for mutual TLS.

func DeregisterConnection

func DeregisterConnection(service string)

DeregisterConnection deregisters the gRPC connection for the specified service name. The server is not stopped before it's deregistered. If no connection is registered for the service name, it will panic.

func DialH2C deprecated

func DialH2C(serverURL string, opts ...grpc.DialOption) (*grpc.ClientConn, error)

DialH2C will establish a connection to the grpcserver.NewStandardH2C server listening at the passed in URL, and return a connection for it. This will _not_ register it in the client registry, that is left to the user.

Deprecated: Use DialH2CContext instead.

func DialH2CContext added in v0.0.15

func DialH2CContext(ctx context.Context, serverURL string, opts ...grpc.DialOption) (*grpc.ClientConn, error)

DialH2CContext will establish a connection to the grpcserver.NewStandardH2C server listening at the passed in URL, and return a connection for it. This will _not_ register it in the client registry, that is left to the user. By default the call is non-blocking. Use WithBlock for a blocking call. In the blocking case, ctx can be used to cancel or expire the pending connection.

func RegisterConnection

func RegisterConnection(service string, cconn *grpc.ClientConn)

RegisterConnection registers the given gRPC connection for usage under the specified service name.

func SkipVerify added in v0.0.6

func SkipVerify(cfg *tls.Config)

SkipVerify disables verification of server certificates.

Types

type TLSOption added in v0.0.6

type TLSOption func(*tls.Config)

TLSOption is a function which modifies a TLS configuration.

Jump to

Keyboard shortcuts

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