package
0.0.4
Repository: https://github.com/fengleng/go-common.git
Documentation: pkg.go.dev

# Functions

NewResourcePool 创建一个资源池子,capacity是池子中可用资源数量 maxCap代表最大资源数量 超过设定空闲时间的连接会被丢弃 资源池会根据传入的factory进行具体资源的初始化,比如建立与mysql的连接.

# Variables

ErrClosed is returned if ResourcePool is used when it's closed.
ErrTimeout is returned if a resource get times out.

# Structs

ResourcePool allows you to use a pool of resources.

# Interfaces

Resource defines the interface that every resource must provide.

# Type aliases

Factory is a function that can be used to create a resource.