-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtiming.go
More file actions
22 lines (18 loc) · 815 Bytes
/
timing.go
File metadata and controls
22 lines (18 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package dcache
import "time"
type CacheDuration time.Duration
const (
SuperFast CacheDuration = CacheDuration(time.Second)
VeryFast CacheDuration = CacheDuration(time.Second * 2)
Fast CacheDuration = CacheDuration(time.Second * 5)
Normal CacheDuration = CacheDuration(time.Second * 10)
Slow CacheDuration = CacheDuration(time.Second * 30)
VerySlow CacheDuration = CacheDuration(time.Minute * 1)
SuperSlow CacheDuration = CacheDuration(time.Minute * 5)
SuperDuperSlow CacheDuration = CacheDuration(time.Hour * 1)
SuperSuperDuperSlow CacheDuration = CacheDuration(time.Hour * 5)
NeverExpire CacheDuration = CacheDuration(0)
)
func (c CacheDuration) ToDuration() time.Duration {
return time.Duration(c)
}