mirror of
https://github.com/gofiber/storage.git
synced 2025-10-09 02:20:20 +08:00
Memory
An in-memory storage driver.
Table of Contents
Signatures
func New(config ...Config) Storage
Examples
Import the storage package.
import "github.com/gofiber/storage/memory"
You can use the following possibilities to create a storage:
// Initialize default config
store := memory.New()
// Initialize custom config
store := memory.New(memory.Config{
GCInterval: 10 * time.Second,
})
Config
type Config struct {
// Time before deleting expired keys
//
// Default is 10 * time.Second
GCInterval time.Duration
}
Default Config
var ConfigDefault = Config{
GCInterval: 10 * time.Second,
}