fix channel caches, add hub functions to api endpoints
This commit is contained in:
Vendored
+12
@@ -26,6 +26,18 @@ func GetUserById(id uuid.UUID) (*types.User, error) {
|
||||
}
|
||||
return user, nil
|
||||
}
|
||||
func GetUsersByIds(ids []uuid.UUID) (users []*types.User, err error) {
|
||||
Mu.RLock()
|
||||
defer Mu.RUnlock()
|
||||
for _, id := range ids {
|
||||
user, ok := Users[id]
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("if %s not found", id)
|
||||
}
|
||||
users = append(users, user)
|
||||
}
|
||||
return users, nil
|
||||
}
|
||||
func GetUserByName(name string) (*types.User, error) {
|
||||
Mu.RLock()
|
||||
defer Mu.RUnlock()
|
||||
|
||||
Reference in New Issue
Block a user