Documentation ¶
Index ¶
- type RedisConn
- type RedisConnectionPool
- func (pool *RedisConnectionPool) Acquire() (*RedisConn, error)
- func (pool *RedisConnectionPool) Check(conn *RedisConn) bool
- func (pool *RedisConnectionPool) Cleaner()
- func (pool *RedisConnectionPool) Close()
- func (pool *RedisConnectionPool) CloseExpiredConnections()
- func (pool *RedisConnectionPool) MaintainMinConnections()
- func (pool *RedisConnectionPool) Open() error
- func (pool *RedisConnectionPool) Release(conn *RedisConn)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedisConnectionPool ¶
type RedisConnectionPool struct { OpenConnection func() (*RedisConn, error) // contains filtered or unexported fields }
RedisConnectionPool manages a set of Redis connections.
func New ¶
func New(maxConn, minConn int, waitTimeout time.Duration) *RedisConnectionPool
New Creates a new Redis connection pool
func (*RedisConnectionPool) Acquire ¶
func (pool *RedisConnectionPool) Acquire() (*RedisConn, error)
Acquire Acquire a connection
func (*RedisConnectionPool) Check ¶
func (pool *RedisConnectionPool) Check(conn *RedisConn) bool
Checker checks if the connection is available
func (*RedisConnectionPool) Cleaner ¶
func (pool *RedisConnectionPool) Cleaner()
Cleaner Clean up expired connections while maintaining minimum number of connections
func (*RedisConnectionPool) Close ¶
func (pool *RedisConnectionPool) Close()
Close closes the connection pool
func (*RedisConnectionPool) CloseExpiredConnections ¶
func (pool *RedisConnectionPool) CloseExpiredConnections()
CloseExpiredConnections Close expired connections
func (*RedisConnectionPool) MaintainMinConnections ¶
func (pool *RedisConnectionPool) MaintainMinConnections()
MaintainMinConnections maintaining minimum number of connections
func (*RedisConnectionPool) Open ¶
func (pool *RedisConnectionPool) Open() error
Open Initialize the connection pool
func (*RedisConnectionPool) Release ¶
func (pool *RedisConnectionPool) Release(conn *RedisConn)
Release releases connections to the pool
Click to show internal directories.
Click to hide internal directories.