dialer

package
v0.0.0-...-55327a3 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(name string, opts ...Option) (*grpc.ClientConn, error)

Dial returns a load balanced grpc client conn with tracing interceptor

Types

type Option

type Option func(*Options)

func WithDialOption

func WithDialOption(gopts ...grpc.DialOption) Option

func WithTraceIdFunc

func WithTraceIdFunc(idFunc tracing.ClientTraceIdFunc) Option

func WithTracer

func WithTracer(t opentracing.Tracer) Option

WithTracer traces rpc calls,the Tracer interceptor must put the last because the context get value limit if use jeagertracer,the context header key will be uber-trace-id,it can't log by zap logger. if you want auto log by CtxTag,the key must be TagTraceID value,set the jeager's configuration key headers.TraceContextHeaderName to `trace.traceid`

func WithUnaryClientInterceptor

func WithUnaryClientInterceptor(interceptors ...grpc.UnaryClientInterceptor) Option

type Options

type Options struct {
	Tracer                  opentracing.Tracer
	UnaryClientInterceptors []grpc.UnaryClientInterceptor
	DialOptions             []grpc.DialOption
	TraceIdFunc             tracing.ClientTraceIdFunc
}

Jump to

Keyboard shortcuts

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