Versions in this module Expand all Collapse all v1 v1.0.0 May 24, 2019 Changes in this version + const FromSlave + const StmtType + var ErrClosed = errors.New("resource pool is closed") + var ErrTimeout = errors.New("resource pool timed out") + func Concat(strings ...string) string + func GetValueExprResult(n *driver.ValueExpr) (interface{}, error) + func HostName(ip string) (hostname string, err error) + func Int2TimeDuration(t int) (time.Duration, error) + func ItoString(a interface{}) (bool, string) + func Left(str string, length int, pad string) string + func ResolveAddr(network string, locAddr string) (string, error) + func Right(str string, length int, pad string) string + type BoolIndex struct + func (b *BoolIndex) Get() (int32, int32, bool) + func (b *BoolIndex) Set(index bool) + type Factory func() (Resource, error) + type IPInfo struct + func ParseIPInfo(v string) (IPInfo, error) + func (t *IPInfo) Info() string + func (t *IPInfo) Match(ip net.IP) bool + type MurmurHash struct + func NewMurmurHash(seed int) *MurmurHash + func (m *MurmurHash) HashUnencodedChars(inputStr string) int + type RequestContext struct + func NewRequestContext() *RequestContext + func (reqCtx *RequestContext) Get(key string) interface{} + func (reqCtx *RequestContext) Set(key string, value interface{}) + type Resource interface + Close func() + type ResourcePool struct + func NewResourcePool(factory Factory, capacity, maxCap int, idleTimeout time.Duration) *ResourcePool + func (rp *ResourcePool) Active() int64 + func (rp *ResourcePool) Available() int64 + func (rp *ResourcePool) Capacity() int64 + func (rp *ResourcePool) Close() + func (rp *ResourcePool) Get(ctx context.Context) (resource Resource, err error) + func (rp *ResourcePool) IdleClosed() int64 + func (rp *ResourcePool) IdleTimeout() time.Duration + func (rp *ResourcePool) InUse() int64 + func (rp *ResourcePool) IsClosed() (closed bool) + func (rp *ResourcePool) MaxCap() int64 + func (rp *ResourcePool) Put(resource Resource) + func (rp *ResourcePool) SetCapacity(capacity int) error + func (rp *ResourcePool) SetIdleTimeout(idleTimeout time.Duration) + func (rp *ResourcePool) StatsJSON() string + func (rp *ResourcePool) WaitCount() int64 + func (rp *ResourcePool) WaitTime() time.Duration + type Task struct + type TimeWheel struct + func NewTimeWheel(tick time.Duration, bucketsNum int) (*TimeWheel, error) + func (tw *TimeWheel) Add(delay time.Duration, key interface{}, callback func()) error + func (tw *TimeWheel) Remove(key interface{}) error + func (tw *TimeWheel) Start() + func (tw *TimeWheel) Stop()