pool

package
v1.7.9 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: Apache-2.0 Imports: 18 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(ctx context.Context, f func(*ClientConn) error) error
	Get(ctx context.Context) (conn *ClientConn, ok bool)
	IsHealthy(context.Context) bool
	IsIPConn() bool
	Len() uint64
	Size() uint64
	Reconnect(ctx context.Context, force bool) (Conn, error)
	String() string
}

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 WithErrGroup added in v1.3.1

func WithErrGroup(eg errgroup.Group) 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