CollectConnectedClientTokens returns all tokens of the connected clients.
()
| 39 | |
| 40 | // CollectConnectedClientTokens returns all tokens of the connected clients. |
| 41 | func (a *API) CollectConnectedClientTokens() []string { |
| 42 | a.lock.RLock() |
| 43 | defer a.lock.RUnlock() |
| 44 | var clients []string |
| 45 | for _, cs := range a.clients { |
| 46 | for _, c := range cs { |
| 47 | clients = append(clients, c.token) |
| 48 | } |
| 49 | } |
| 50 | return uniq(clients) |
| 51 | } |
| 52 | |
| 53 | // NotifyDeletedUser closes existing connections for the given user. |
| 54 | func (a *API) NotifyDeletedUser(userID uint) error { |