mirror of
https://github.com/gofiber/storage.git
synced 2025-10-07 09:31:44 +08:00
🎨 update memory storage
This commit is contained in:
21
memory/config.go
Normal file
21
memory/config.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package memory
|
||||
|
||||
import "time"
|
||||
|
||||
// Config defines the config for memory storage.
|
||||
type Config struct {
|
||||
GCInterval time.Duration
|
||||
}
|
||||
|
||||
// ConfigDefault is the default config
|
||||
var ConfigDefault = Config{
|
||||
GCInterval: 10 * time.Second,
|
||||
}
|
||||
|
||||
// Helper function to set default values
|
||||
func configDefault(cfg Config) Config {
|
||||
if int(cfg.GCInterval) == 0 {
|
||||
cfg.GCInterval = ConfigDefault.GCInterval
|
||||
}
|
||||
return cfg
|
||||
}
|
Reference in New Issue
Block a user