Documentation ¶
Index ¶
- func GetConnectionByParams(Ctx context.Context, connCache *SafeDbMapCache, duration time.Duration, ...) (*sqlx.DB, error)
- type PoolItem
- type SafeDbMapCache
- func (c *SafeDbMapCache) ClearAll()
- func (c *SafeDbMapCache) Delete(key string) error
- func (c *SafeDbMapCache) ExpiredKeys() (keys []string)
- func (c *SafeDbMapCache) GC()
- func (c *SafeDbMapCache) Get(key string) (*sqlx.DB, bool)
- func (c *SafeDbMapCache) GetItems() (items []string)
- func (c *SafeDbMapCache) Set(key string, value *sqlx.DB, duration time.Duration)
- func (c *SafeDbMapCache) StartGC()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SafeDbMapCache ¶
func New ¶
func New(defaultExpiration, cleanupInterval time.Duration) *SafeDbMapCache
New - initializing a new SafeDbMapCache cache
func (*SafeDbMapCache) Delete ¶
func (c *SafeDbMapCache) Delete(key string) error
Delete - delete *sqlx.DB value by key Return false if key not found
func (*SafeDbMapCache) ExpiredKeys ¶
func (c *SafeDbMapCache) ExpiredKeys() (keys []string)
ExpiredKeys - returns list of expired keys.
func (*SafeDbMapCache) Get ¶
func (c *SafeDbMapCache) Get(key string) (*sqlx.DB, bool)
Get - getting *sqlx.DB value by key
func (*SafeDbMapCache) GetItems ¶
func (c *SafeDbMapCache) GetItems() (items []string)
GetItems - returns item list.
func (*SafeDbMapCache) StartGC ¶
func (c *SafeDbMapCache) StartGC()
StartGC - start Garbage Collection
Click to show internal directories.
Click to hide internal directories.