NotifyDeletedUser closes existing connections for the given user.
(userID uint)
| 52 | |
| 53 | // NotifyDeletedUser closes existing connections for the given user. |
| 54 | func (a *API) NotifyDeletedUser(userID uint) error { |
| 55 | a.lock.Lock() |
| 56 | defer a.lock.Unlock() |
| 57 | if clients, ok := a.clients[userID]; ok { |
| 58 | for _, client := range clients { |
| 59 | client.Close() |
| 60 | } |
| 61 | delete(a.clients, userID) |
| 62 | } |
| 63 | return nil |
| 64 | } |
| 65 | |
| 66 | // NotifyDeletedClient closes existing connections with the given token. |
| 67 | func (a *API) NotifyDeletedClient(userID uint, token string) { |