mirror of
https://github.com/gofiber/storage.git
synced 2025-10-27 18:30:29 +08:00
🧹 introduce reset and close
This commit is contained in:
@@ -152,11 +152,16 @@ func (s *Storage) Delete(key string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// Clear all keys by drop collection
|
||||
func (s *Storage) Clear() error {
|
||||
// Reset all keys by drop collection
|
||||
func (s *Storage) Reset() error {
|
||||
return s.col.Drop(context.Background())
|
||||
}
|
||||
|
||||
// Close the database
|
||||
func (s *Storage) Close() error {
|
||||
return s.db.Client().Disconnect(context.Background())
|
||||
}
|
||||
|
||||
// Acquire item from pool
|
||||
func (s *Storage) acquireItem() *item {
|
||||
return s.items.Get().(*item)
|
||||
|
||||
Reference in New Issue
Block a user