Documentation ¶
Index ¶
- type GoPool
- func (gp *GoPool) Acquire() (interface{}, error)
- func (gp *GoPool) AcquireDecode(v interface{}) error
- func (gp *GoPool) AcquireString() (string, error)
- func (gp *GoPool) Clear()
- func (gp *GoPool) Release(v interface{}) error
- func (gp *GoPool) ReleaseEncode(v interface{}) error
- func (gp *GoPool) ReleaseString(v string) error
- type Pool
- type RedisPool
- func (rp *RedisPool) Acquire() (interface{}, error)
- func (rp *RedisPool) AcquireDecode(v interface{}) error
- func (rp *RedisPool) AcquireString() (string, error)
- func (rp *RedisPool) Clear()
- func (rp *RedisPool) Release(v interface{}) error
- func (rp *RedisPool) ReleaseEncode(v interface{}) error
- func (rp *RedisPool) ReleaseString(v string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GoPool ¶
GoPool golang资源池
func (*GoPool) AcquireDecode ¶
AcquireDecode 从资源池中获取一个资源, 并解析到v
func (*GoPool) AcquireString ¶ added in v0.2.4
AcquireString 从资源池中获取一个资源
func (*GoPool) ReleaseEncode ¶
ReleaseEncode 释放一个资源到资源池
func (*GoPool) ReleaseString ¶ added in v0.2.4
ReleaseString 释放一个资源到资源池
type Pool ¶
type Pool interface { // Acquire 从资源池中获取一个资源 Acquire() (interface{}, error) // Release 释放一个资源到资源池 Release(interface{}) error // AcquireDecode 从资源池中获取一个资源 AcquireDecode(v interface{}) error // ReleaseEncode 释放一个资源到资源池 ReleaseEncode(v interface{}) error // AcquireString 从资源池中获取一个资源 AcquireString() (string, error) // ReleaseString 释放一个资源到资源池 ReleaseString(string) error // Clear 清空资源池 Clear() }
Pool 资源池接口
type RedisPool ¶
type RedisPool struct {
// contains filtered or unexported fields
}
RedisPool redis资源池
func NewRedisPool ¶
NewRedisPool 创建一个redis资源池
func (*RedisPool) AcquireDecode ¶
AcquireDecode 从资源池中获取一个资源, 并json解析到v
func (*RedisPool) AcquireString ¶ added in v0.2.4
AcquireString 从资源池中获取一个资源, 返回值为string
func (*RedisPool) ReleaseEncode ¶
ReleaseEncode 释放一个资源到资源池, 并json编码
func (*RedisPool) ReleaseString ¶ added in v0.2.4
ReleaseString 释放一个资源到资源池, v为string
Click to show internal directories.
Click to hide internal directories.