pool

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitConnPool

func InitConnPool(pool ConnPool)

Types

type ConnPool

type ConnPool interface {
	Get(ctx context.Context) (net.Conn, error)
	ReconnectTrigger() chan struct{}
}

func GetConnPool

func GetConnPool() ConnPool

GetConnPool first executes InitConnPool and then calls it, otherwise it returns nil

func NewSingleConnPool

func NewSingleConnPool(ctx context.Context, dialer func() (net.Conn, error), opts ...Option) ConnPool

type Option

type Option func(*Options)

func WithAddrChangedSignalCh

func WithAddrChangedSignalCh(addrChangedSignalCh chan struct{}) Option

func WithPostDialer

func WithPostDialer(postDialer func(context.Context, net.Conn) error) Option

type Options

type Options struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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