Get returns the timeout for the provided key
(key string)
| 40 | |
| 41 | // Get returns the timeout for the provided key |
| 42 | func Get(key string) time.Duration { |
| 43 | mu.RLock() |
| 44 | t, ok := timeouts[key] |
| 45 | mu.RUnlock() |
| 46 | if !ok { |
| 47 | t = DefaultTimeout |
| 48 | } |
| 49 | return t |
| 50 | } |
| 51 | |
| 52 | // WithContext returns a context with the specified timeout for the provided key |
| 53 | func WithContext(ctx context.Context, key string) (context.Context, func()) { |
no outgoing calls
no test coverage detected