Get returns the cached shortcode for a URL
(url string)
| 23 | |
| 24 | // Get returns the cached shortcode for a URL |
| 25 | func (c *urlCache) Get(url string) (string, bool) { |
| 26 | c.mutex.RLock() |
| 27 | defer c.mutex.RUnlock() |
| 28 | code, ok := c.cache[url] |
| 29 | return code, ok |
| 30 | } |
| 31 | |
| 32 | // Set caches a URL and its shortcode |
| 33 | func (c *urlCache) Set(url, code string) { |
no outgoing calls
no test coverage detected