client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2020 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectViaProxy

func ConnectViaProxy(ctx context.Context, endpoint string, tlsClientConf *tls.Config, opts ...ConnectOption) (*grpc.ClientConn, error)

ConnectViaProxy establishes a gRPC client connection via a HTTP/2 proxy that handles endpoints behind HTTP/1 proxies.

Types

type ConnectOption

type ConnectOption interface {
	// contains filtered or unexported methods
}

ConnectOption is an option that can be passed to the `ConnectViaProxy` method.

func DialOpts

func DialOpts(dialOpts ...grpc.DialOption) ConnectOption

DialOpts returns a connect option that applies the given gRPC dial options when connecting.

func ExtraH2ALPNs

func ExtraH2ALPNs(alpns ...string) ConnectOption

ExtraH2ALPNs returns a connection option that instructs the client to use the given ALPN names as HTTP/2 equivalent.

func ForceHTTP2

func ForceHTTP2() ConnectOption

ForceHTTP2 returns a connection option that instructs the client to force using HTTP/2 even in the absence of ALPN. This is required for servers that only speak HTTP/2 (e.g., the vanilla gRPC server regardless of the language), but might break things if the server does not support HTTP/2 or expects HTTP/1. Generally, working with any kind of server requires a TLS connection that allows for ALPN.

Jump to

Keyboard shortcuts

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