Set binds a session to an auth ID with TTL refresh.
(sessionID, authID string)
| 82 | |
| 83 | // Set binds a session to an auth ID with TTL refresh. |
| 84 | func (c *SessionCache) Set(sessionID, authID string) { |
| 85 | if sessionID == "" || authID == "" { |
| 86 | return |
| 87 | } |
| 88 | c.mu.Lock() |
| 89 | c.entries[sessionID] = sessionEntry{ |
| 90 | authID: authID, |
| 91 | expiresAt: time.Now().Add(c.ttl), |
| 92 | } |
| 93 | c.mu.Unlock() |
| 94 | } |
| 95 | |
| 96 | // Invalidate removes a specific session binding. |
| 97 | func (c *SessionCache) Invalidate(sessionID string) { |
no outgoing calls