Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectionMode ¶
type ConnectionMode int
What mode are we building the connection pool in?
const ( LAZY ConnectionMode AGRESSIVE )
How should we populate the connection pool?
type RedisConnection ¶
type RedisConnection struct { Url string "Redis URL this factory will connect to" Logger *log4go.Logger "Handle to the logger we are using" // contains filtered or unexported fields }
Connection Wrapper for Redis
func (*RedisConnection) Client ¶
func (p *RedisConnection) Client() (*redis.Client, error)
Get a connection to Redis
func (*RedisConnection) Close ¶
func (p *RedisConnection) Close(err error)
Close the connection to redis
func (*RedisConnection) IsClosed ¶
func (p *RedisConnection) IsClosed() bool
Return true if the client connection exists
func (*RedisConnection) IsOpen ¶
func (p *RedisConnection) IsOpen() bool
Return true if the client connection exists
func (*RedisConnection) Open ¶
func (p *RedisConnection) Open() (err error)
Open a new connection to redis
func (*RedisConnection) Ping ¶
func (p *RedisConnection) Ping() error
Ping the server, opening the client connection if necessary Returns:
nil --> Ping was successful! error --> Ping was failure
type RedisConnectionPool ¶
type RedisConnectionPool struct { Mode ConnectionMode "How should we prepare the connection pool?" Size int "(Max) Pool size" Urls []string "Redis URLs to connect to" Logger log4go.Logger "Logger we are using in the connection pool" // contains filtered or unexported fields }
Redis Connection Pool wrapper
func (*RedisConnectionPool) Open ¶
func (p *RedisConnectionPool) Open() error
Open the connection pool
func (*RedisConnectionPool) Pop ¶
func (p *RedisConnectionPool) Pop() (*RedisConnection, error)
Get a RedisConnection from the pool
func (*RedisConnectionPool) Push ¶
func (p *RedisConnectionPool) Push(c *RedisConnection)
Return a RedisConnection
Click to show internal directories.
Click to hide internal directories.