pool

package
v0.0.60 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package pool provides grpc connection pool client

Package pool provides grpc connection pool client

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientConn

type ClientConn = grpc.ClientConn

type Conn

type Conn interface {
	Connect(context.Context) (Conn, error)
	Disconnect() error
	Do(f func(*ClientConn) error) error
	Get() (*ClientConn, bool)
	IsHealthy(context.Context) bool
	Len() uint64
	Size() uint64
	Reconnect(ctx context.Context, force bool) (Conn, error)
}

func New

func New(ctx context.Context, opts ...Option) (c Conn, err error)

type DialOption

type DialOption = grpc.DialOption

type Option

type Option func(*pool)

func WithAddr

func WithAddr(addr string) Option

func WithBackoff

func WithBackoff(bo backoff.Backoff) Option

func WithDialOptions

func WithDialOptions(opts ...DialOption) Option

func WithDialTimeout added in v0.0.32

func WithDialTimeout(dur string) Option

func WithEndPort

func WithEndPort(port int) Option

func WithHost

func WithHost(host string) Option

func WithOldConnCloseDuration added in v0.0.29

func WithOldConnCloseDuration(dur string) Option

func WithPort

func WithPort(port int) Option

func WithResolveDNS added in v0.0.45

func WithResolveDNS(flg bool) Option

func WithSize

func WithSize(size uint64) Option

func WithStartPort

func WithStartPort(port int) Option

Jump to

Keyboard shortcuts

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