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)
| 1650 | // capacity that uses an LRU strategy. If capacity is < 1, a default capacity |
| 1651 | // is used instead. |
| 1652 | func NewLRUClientSessionCache(capacity int) ClientSessionCache { |
| 1653 | const defaultSessionCacheCapacity = 64 |
| 1654 | |
| 1655 | if capacity < 1 { |
| 1656 | capacity = defaultSessionCacheCapacity |
| 1657 | } |
| 1658 | return &lruSessionCache{ |
| 1659 | m: make(map[string]*list.Element), |
| 1660 | q: list.New(), |
| 1661 | capacity: capacity, |
| 1662 | } |
| 1663 | } |
| 1664 | |
| 1665 | // Put adds the provided (sessionKey, cs) pair to the cache. If cs is nil, the entry |
| 1666 | // corresponding to sessionKey is removed from the cache instead. |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…