user

package
v1.4.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2025 License: Unlicense Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SystemUser = "system"
)

Variables

This section is empty.

Functions

func DeleteUser added in v1.1.4

func DeleteUser(database *server.Database, email string) error

DeleteUser Removes the requested users account from the MongoDB database. Does not remove there account from Auth0. Returns ErrUserMissingId if email is empty string, returns ErrInvalidEmail if the email address passed is not valid, returns ErrUserDeleteFailed if the DeletedCount is less than 1, and returns nil otherwise

func GetUser

func GetUser(database *server.Database, email string) (*userModel.User, error)

GetUser Fetch a user based on their username. Returns ErrNoUser if the user cannot be found

func IndexUsers added in v1.1.4

func IndexUsers(database *server.Database, limit int64) ([]*user.User, error)

IndexUsers List all users from the database, and return them in a slice. A limit can be provided to ensure that too many objects don't get returned

func NewUser

func NewUser(database *server.Database, user *userModel.User) error

NewUser Insert the contents of a User model in the MongoDB database. Returns ErrUserMissingId if the Username, or Email is not present Returns ErrUserAlreadyExist if a user already exists under this username

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL