NewLRUClientSessionCache returns a ClientSessionCache with the given capacity that uses an LRU strategy. If capacity is < 1, a default capacity is used instead.
(capacity int)
| 1398 | // capacity that uses an LRU strategy. If capacity is < 1, a default capacity |
| 1399 | // is used instead. |
| 1400 | func NewLRUClientSessionCache(capacity int) ClientSessionCache { |
| 1401 | const defaultSessionCacheCapacity = 64 |
| 1402 | |
| 1403 | if capacity < 1 { |
| 1404 | capacity = defaultSessionCacheCapacity |
| 1405 | } |
| 1406 | return &lruSessionCache{ |
| 1407 | m: make(map[string]*list.Element), |
| 1408 | q: list.New(), |
| 1409 | capacity: capacity, |
| 1410 | } |
| 1411 | } |
| 1412 | |
| 1413 | // Put adds the provided (sessionKey, cs) pair to the cache. If cs is nil, the entry |
| 1414 | // corresponding to sessionKey is removed from the cache instead. |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…