We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 666626c commit 163fe5fCopy full SHA for 163fe5f
internal/session/utils.go
@@ -17,3 +17,18 @@ func (s *Session) serializeSessionForRedis() map[string]interface{} {
17
"failed": s.FailedCount,
18
}
19
20
+
21
+/* returns all the usernames in the manager */
22
+func (m *Manager) GetAllUsernames() []string {
23
+ /* thread safety of manager */
24
+ m.mutex.Lock()
25
+ defer m.mutex.Unlock()
26
27
+ /* create and fill slice for usernames */
28
+ usernames := make([]string, 0, len(m.sessionsMap))
29
+ for _, session := range m.sessionsMap {
30
+ usernames = append(usernames, session.Username)
31
+ }
32
33
+ return usernames
34
+}
0 commit comments