-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathconfig.go
More file actions
30 lines (23 loc) · 708 Bytes
/
Copy pathconfig.go
File metadata and controls
30 lines (23 loc) · 708 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package gocache
import "time"
const (
// DefaultExpire is default expiration date.
DefaultExpire = int64(50 * time.Second)
// DeleteExpiredInterval is the default interval at which the worker deltes all expired cache objects
DeleteExpiredInterval = int64(10 * time.Second)
// DefaultShardsCount is the number of elements of concurrent map.
DefaultShardsCount uint64 = 512
s = 1 * time.Second
)
type config struct {
ShardsCount uint64
Expire int64
DeleteExpiredInterval int64
}
func newDefaultConfig() *config {
return &config{
ShardsCount: DefaultShardsCount,
Expire: DefaultExpire,
DeleteExpiredInterval: DeleteExpiredInterval,
}
}