Set the timeout for the key
(key string, t time.Duration)
| 33 | |
| 34 | // Set the timeout for the key |
| 35 | func Set(key string, t time.Duration) { |
| 36 | mu.Lock() |
| 37 | timeouts[key] = t |
| 38 | mu.Unlock() |
| 39 | } |
| 40 | |
| 41 | // Get returns the timeout for the provided key |
| 42 | func Get(key string) time.Duration { |