grpcclientutil

package
v0.0.0-...-6719cd2 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package grpcclientutil has helpers for configuring gRPC clients.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InsecureDialContext

func InsecureDialContext(connectCtx context.Context, address string, opts ...grpc.DialOption) *grpc.ClientConn

InsecureDialContext connects to the given address. It sets up Prometheus and OpenTracing monitoring. It disables transport-level security.

The actual connection happens in the background; the given 'connectCtx' can be used to cancel this background activity. The caller must not pass grpc.WithBlock() as an option.

func InvalidConn

func InvalidConn(msg string) *grpc.ClientConn

InvalidConn returns a non-nil gRPC connection in the TransientFailure state. Callers should Close() the returned connection when they're done with it.

InvalidConn can be useful to generate a dummy value in situations where having a nil grpc.ClientConn would be inconvenient.

func StreamInterceptorChain

func StreamInterceptorChain(first, second grpc.StreamClientInterceptor) grpc.StreamClientInterceptor

StreamInterceptorChain lets you use multiple stream interceptors on a single client. gRPC only lets you have one top-level StreamClientInterceptor per client, so this chains them together.

func UnaryInterceptorChain

func UnaryInterceptorChain(first, second grpc.UnaryClientInterceptor) grpc.UnaryClientInterceptor

UnaryInterceptorChain lets you use multiple interceptors on a single client. gRPC only lets you have one top-level UnaryClientInterceptor per client, so this chains them together.

Types

This section is empty.

Jump to

Keyboard shortcuts

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