rpcd

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(addr string, opts ...DialOption) (*grpc.ClientConn, error)

Dial returns a load balanced grpc client conn with tracing interceptor

Types

type ClientConn

type ClientConn interface {
	Invoke(ctx context.Context, method string, args interface{}, reply interface{}, opts ...grpc.CallOption) error
	Close() error
}

type DialOption

type DialOption func(name string) (grpc.DialOption, error)

DialOption allows optional config for dialer

func WithInsecure

func WithInsecure() DialOption

WithCredentials

func WithTracer

func WithTracer(t opentracing.Tracer) DialOption

WithTracer traces rpc calls

type Dialer

type Dialer struct {
	ServiceName string
	Address     string
	Conn        *grpc.ClientConn
	Logger      *zap.SugaredLogger
}

func NewDialer

func NewDialer(ctx context.Context, lg *zap.SugaredLogger, name, addr string, opts ...DialOption) (*Dialer, error)

func (*Dialer) GracefulShutdown

func (d *Dialer) GracefulShutdown(ctx context.Context)

func (*Dialer) WithCancel

func (d *Dialer) WithCancel(ctx context.Context) func()

type RpcDialer

type RpcDialer interface {
	WithCancel(ctx context.Context) func()
	GracefulShutdown(ctx context.Context)
}

Jump to

Keyboard shortcuts

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