pool

package
v0.0.0-...-3a6a5bb Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrExceeded = errors.New("Maximum number of connections exceeded")

Functions

This section is empty.

Types

type Connection

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

func NewConnection

func NewConnection(c *grpc.ClientConn) *Connection

type GRPCPool

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

func NewGRPCPool

func NewGRPCPool(host string, options *Options, dialOptions ...grpc.DialOption) (*GRPCPool, error)

func (*GRPCPool) Get

func (pool *GRPCPool) Get() (*grpc.ClientConn, error)

func (*GRPCPool) Put

func (pool *GRPCPool) Put(connection *grpc.ClientConn) error

type Options

type Options struct {
	InitCap     int
	MaxCap      int
	DialTimeout time.Duration
	IdleTimeout time.Duration
}

func NewOptions

func NewOptions() *Options

Jump to

Keyboard shortcuts

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