Documentation
ΒΆ
Index ΒΆ
- Variables
- type Client
- type Connection
- func (conn *Connection) ClearSession()
- func (conn *Connection) Close() error
- func (conn *Connection) GetClient() interface{}
- func (conn *Connection) GetCreateTime() time.Time
- func (conn *Connection) GetPool() RPool
- func (conn *Connection) GetSession() interface{}
- func (conn *Connection) GetUsage() int64
- func (conn *Connection) GetVersion() int64
- func (conn *Connection) HandleClose(_close func() error)
- func (conn *Connection) HandleIsClosed(isClosed func() bool)
- func (conn *Connection) HandleReset(reset func() error)
- func (conn *Connection) IncrUsage()
- func (conn *Connection) IsClosed() bool
- func (conn *Connection) Reset() error
- func (conn *Connection) SetSession(session interface{})
- type Pool
- func (pool *Pool) Acquire() (conn RConnection, err error)
- func (pool *Pool) Capacity() int
- func (pool *Pool) GetDescription() string
- func (pool *Pool) GetDomain() string
- func (pool *Pool) GetPayload() interface{}
- func (pool *Pool) GetVersion() int64
- func (pool *Pool) IncrVersion()
- func (pool *Pool) Len() int
- func (pool *Pool) Release(conn RConnection)
- func (pool *Pool) SetCapacity(limit int)
- func (pool *Pool) SetConnExpire(expire time.Duration)
- func (pool *Pool) SetConnMaxUsage(usage int64)
- func (pool *Pool) SetDescription(description string)
- func (pool *Pool) SetDropConnThreshold(threshold float64)
- func (pool *Pool) SetPayload(payload interface{})
- type RConnection
- type RPool
- type Ring
- type Statistics
Constants ΒΆ
This section is empty.
Variables ΒΆ
View Source
var (
ErrExceedMaxPoolLimit = errors.New("exceed max pool limit")
)
Functions ΒΆ
This section is empty.
Types ΒΆ
type Connection ΒΆ
type Connection struct {
// contains filtered or unexported fields
}
func NewConnection ΒΆ
func NewConnection(pool RPool, client interface{}, version int64) *Connection
func (*Connection) ClearSession ΒΆ
func (conn *Connection) ClearSession()
func (*Connection) Close ΒΆ
func (conn *Connection) Close() error
func (*Connection) GetClient ΒΆ
func (conn *Connection) GetClient() interface{}
func (*Connection) GetCreateTime ΒΆ
func (conn *Connection) GetCreateTime() time.Time
func (*Connection) GetPool ΒΆ
func (conn *Connection) GetPool() RPool
func (*Connection) GetSession ΒΆ
func (conn *Connection) GetSession() interface{}
func (*Connection) GetUsage ΒΆ
func (conn *Connection) GetUsage() int64
func (*Connection) GetVersion ΒΆ
func (conn *Connection) GetVersion() int64
func (*Connection) HandleClose ΒΆ
func (conn *Connection) HandleClose(_close func() error)
func (*Connection) HandleIsClosed ΒΆ
func (conn *Connection) HandleIsClosed(isClosed func() bool)
func (*Connection) HandleReset ΒΆ
func (conn *Connection) HandleReset(reset func() error)
func (*Connection) IncrUsage ΒΆ
func (conn *Connection) IncrUsage()
func (*Connection) IsClosed ΒΆ
func (conn *Connection) IsClosed() bool
func (*Connection) Reset ΒΆ
func (conn *Connection) Reset() error
func (*Connection) SetSession ΒΆ
func (conn *Connection) SetSession(session interface{})
type Pool ΒΆ
type Pool struct {
// contains filtered or unexported fields
}
func (*Pool) Acquire ΒΆ
func (pool *Pool) Acquire() (conn RConnection, err error)
func (*Pool) GetDescription ΒΆ
func (*Pool) GetPayload ΒΆ
func (pool *Pool) GetPayload() interface{}
func (*Pool) GetVersion ΒΆ
func (*Pool) IncrVersion ΒΆ
func (pool *Pool) IncrVersion()
func (*Pool) Release ΒΆ
func (pool *Pool) Release(conn RConnection)
func (*Pool) SetCapacity ΒΆ
func (*Pool) SetConnExpire ΒΆ
func (*Pool) SetConnMaxUsage ΒΆ
func (*Pool) SetDescription ΒΆ
func (*Pool) SetDropConnThreshold ΒΆ
func (*Pool) SetPayload ΒΆ
func (pool *Pool) SetPayload(payload interface{})
type RConnection ΒΆ
type RConnection interface {
GetUsage() int64
GetPool() RPool
GetVersion() int64
GetClient() interface{}
SetSession(interface{})
GetSession() interface{}
GetCreateTime() time.Time
IncrUsage()
Close() error
Reset() error
IsClosed() bool
HandleClose(func() error)
HandleReset(func() error)
HandleIsClosed(func() bool)
}
type RPool ΒΆ
type RPool interface {
GetDomain() string
Acquire() (RConnection, error)
Release(RConnection)
GetPayload() interface{}
SetPayload(interface{})
GetDescription() string
SetDescription(string)
GetVersion() int64
IncrVersion()
SetConnExpire(time.Duration)
SetConnMaxUsage(int64)
SetDropConnThreshold(float64)
Len() int
Capacity() int
SetCapacity(int)
}
type Ring ΒΆ
func (*Ring) Pop ΒΆ
func (r *Ring) Pop() (conn RConnection)
func (*Ring) Push ΒΆ
func (r *Ring) Push(conn RConnection)
type Statistics ΒΆ
Click to show internal directories.
Click to hide internal directories.