22 lines
393 B
Go
22 lines
393 B
Go
|
//
|
||
|
// config.go
|
||
|
// Copyright (C) 2023 tiglog <me@tiglog.com>
|
||
|
//
|
||
|
// Distributed under terms of the MIT license.
|
||
|
//
|
||
|
|
||
|
package gcache
|
||
|
|
||
|
import "time"
|
||
|
|
||
|
type Config struct {
|
||
|
shards int
|
||
|
expiredCallback ExpiredCallback
|
||
|
hash IHash
|
||
|
clearInterval time.Duration
|
||
|
}
|
||
|
|
||
|
func NewConfig() *Config {
|
||
|
return &Config{shards: 1024, hash: newDefaultHash(), clearInterval: 1 * time.Second}
|
||
|
}
|