pool

package
Version: v0.0.0-...-7995a24 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionInfo

type ConnectionInfo struct {
	Conns []*grpc.ClientConn // connections
	Index int64              // index of the next connection
}

connection info

type ConnectionPool

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

connection pool

func GetConnectionPool

func GetConnectionPool() *ConnectionPool

get connection pool instance

func NewConnectionPool

func NewConnectionPool() *ConnectionPool

func (*ConnectionPool) Close

func (connPool *ConnectionPool) Close()

close connection pool

func (*ConnectionPool) GetConnection

func (connPool *ConnectionPool) GetConnection(ctx context.Context, addr string) (*grpc.ClientConn, error)

get connection from pool

func (*ConnectionPool) Init

func (connPool *ConnectionPool) Init(clientOpts []grpc.DialOption) error

init connection pool

Jump to

Keyboard shortcuts

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