(header string)
| 18 | } |
| 19 | |
| 20 | func (c *cache) lookup(header string) *user.User { |
| 21 | v, ok := c.get(header) |
| 22 | if ok { |
| 23 | if time.Now().Before(v.expires) { |
| 24 | return v.user |
| 25 | } else { |
| 26 | c.delete(header) |
| 27 | } |
| 28 | } |
| 29 | return nil |
| 30 | } |
| 31 | |
| 32 | func (c *cache) get(header string) (v cacheValue, ok bool) { |
| 33 | c.RLock() |
no test coverage detected