GetCacheBefore : can pass time for testing
(key string, time time.Time)
| 19 | |
| 20 | // GetCacheBefore : can pass time for testing |
| 21 | func (s playerCache) GetCacheBefore(key string, time time.Time) playerConfig { |
| 22 | if key == s.key && s.expiredAt.After(time) { |
| 23 | return s.config |
| 24 | } |
| 25 | return nil |
| 26 | } |
| 27 | |
| 28 | // Set : set cache with default expiration |
| 29 | func (s *playerCache) Set(key string, operations playerConfig) { |
no outgoing calls