Documentation ¶
Index ¶
- func AddUser(db *mongo.Collection, user *users.InternalUser) (*users.User, error)
- func CountUsers(db *mongo.Collection) (int64, error)
- func GetUserByEmail(db *mongo.Collection, email string) (*users.User, error)
- func GetUserByID(db *mongo.Collection, userID *users.UserID) (*users.User, error)
- func HasAdminUser(db *mongo.Collection, excluded []*users.UserID) (bool, error)
- func RemoveUser(db *mongo.Collection, userID *users.UserID) error
- func StreamUsers(db *mongo.Collection, stream pb.UserManagement_GetUsersServer) error
- func StreamUsersByTransportID(db *mongo.Collection, transportID *ids.CeptaTransportID, ...) error
- func UpdateUser(db *mongo.Collection, userID *users.UserID, update *users.InternalUser) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddUser ¶
func AddUser(db *mongo.Collection, user *users.InternalUser) (*users.User, error)
AddUser adds a new user to the database
func CountUsers ¶ added in v0.3.2
func CountUsers(db *mongo.Collection) (int64, error)
CountUsers ...
func GetUserByEmail ¶
GetUserByEmail queries the user database by email
func GetUserByID ¶
GetUserByID queries the user database by id
func HasAdminUser ¶
HasAdminUser checks if at least one admin user exists in the database
func RemoveUser ¶
func RemoveUser(db *mongo.Collection, userID *users.UserID) error
RemoveUser deletes a user from the database
func StreamUsers ¶ added in v0.3.2
func StreamUsers(db *mongo.Collection, stream pb.UserManagement_GetUsersServer) error
StreamUsers ...
func StreamUsersByTransportID ¶ added in v0.3.2
func StreamUsersByTransportID(db *mongo.Collection, transportID *ids.CeptaTransportID, stream pb.UserManagement_GetSubscribersForTransportServer) error
StreamUsersByTransportID ...
func UpdateUser ¶
func UpdateUser(db *mongo.Collection, userID *users.UserID, update *users.InternalUser) error
UpdateUser updates selected properties for a user id If the user does not yet exist, an error is returned
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.