Files
storage/memory/config.go
2020-10-31 10:16:11 +01:00

22 lines
404 B
Go

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
}