fix channel caches, add hub functions to api endpoints

This commit is contained in:
2026-05-02 12:59:05 +02:00
parent b5623feb5a
commit 40cb7736c2
9 changed files with 184 additions and 70 deletions
+12
View File
@@ -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()