Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrConnNotReady = errors.New("conn is not ready") ErrConnClosed = errors.New("conn is closed") )
View Source
var (
ErrManagerClosed = errors.New("manager is closed")
)
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn interface { Get(ctx context.Context) (*grpc.ClientConn, io.Closer, error) Close() error IsClosed() bool }
Conn is a interface because the default implementation is that there is only one connection for an address, but for some special cases, you may need an address with a connection pool.
func NewDefaultConn ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manage a Conn for an address
func NewManager ¶
func NewManager(opts ...ManagerOption) *Manager
type ManagerOption ¶
type ManagerOption func(options *managerOptions)
func WithConnFunc ¶
func WithConnFunc(connFunc ConnFunc) ManagerOption
func WithDialFunc ¶
func WithDialFunc(dialFunc DialFunc) ManagerOption
Click to show internal directories.
Click to hide internal directories.