golib/gcache/config.go

22 lines
393 B
Go
Raw Normal View History

2023-10-11 07:36:56 +08:00
//
// 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}
}