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

func WithDialTimeout(dur string) Option

func WithEndPort

func WithEndPort(port int) Option

func WithHost

func WithHost(host string) Option

func WithOldConnCloseDuration

func WithOldConnCloseDuration(dur string) Option

func WithPort

func WithPort(port int) Option

func WithResolveDNS

func WithResolveDNS(flg bool) Option

func WithSize

func WithSize(size uint64) Option

func WithStartPort

func WithStartPort(port int) Option

Source Files