pool

package
v0.0.0-...-8eef2bf Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrClosed = errors.New("pool is closed")

Functions

This section is empty.

Types

type Check

type Check func(net.Conn) error

type Conn

type Conn struct {
	net.Conn
	// contains filtered or unexported fields
}

func (*Conn) Close

func (c *Conn) Close() error

type Factory

type Factory func() (net.Conn, error)

type Pool

type Pool interface {
	Get() (net.Conn, error)
	Len() int
	Close()
}

func NewPool

func NewPool(initSize, capSize int, factory Factory, check Check) (Pool, error)

Jump to

Keyboard shortcuts

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