mirror of
https://gitee.com/johng/gf
synced 2026-06-06 02:25:47 +08:00
add GetAdapter for package gcache; add GetStorage for package gsession
This commit is contained in:
@ -49,6 +49,11 @@ func (c *Cache) SetAdapter(adapter Adapter) {
|
||||
c.localAdapter = adapter
|
||||
}
|
||||
|
||||
// GetAdapter returns the adapter that is set in current Cache.
|
||||
func (c *Cache) GetAdapter() Adapter {
|
||||
return c.localAdapter
|
||||
}
|
||||
|
||||
// Removes deletes `keys` in the cache.
|
||||
func (c *Cache) Removes(ctx context.Context, keys []interface{}) error {
|
||||
_, err := c.Remove(ctx, keys...)
|
||||
|
||||
@ -60,6 +60,11 @@ func (m *Manager) SetStorage(storage Storage) {
|
||||
m.storage = storage
|
||||
}
|
||||
|
||||
// GetStorage returns the session storage of current manager.
|
||||
func (m *Manager) GetStorage() Storage {
|
||||
return m.storage
|
||||
}
|
||||
|
||||
// SetTTL the TTL for the session manager.
|
||||
func (m *Manager) SetTTL(ttl time.Duration) {
|
||||
m.ttl = ttl
|
||||
|
||||
Reference in New Issue
Block a user