# Functions
ActivateEmail activates the email address to given user.
ActivateUserEmail will change the activated state of an email address, either primary or secondary (all in the email_address table).
AddUserBadge adds a badge to a user.
AddUserBadges adds badges to a user.
AddUserOpenID adds an pre-verified/normalized OpenID URI to given user.
AdminCreateUser is used by admins to manually create users.
BuildCanSeeUserCondition creates a condition which can be used to restrict results to users/orgs the actor can see.
ChangeInactivePrimaryEmail replaces the inactive primary email of a given user.
CountUsers returns number of users.
CountWrongUserType count OrgUser who have wrong type.
CreateBadge creates a new badge.
CreateUser creates record of a new user.
DeleteBadge deletes a badge.
DeleteUserOpenID deletes an openid address of given user.
DeleteUserRedirect delete any redirect from the specified user name to anything else.
DeleteUserSetting deletes a specific setting for a user.
DisabledFeaturesWithLoginType returns the set of user features disabled, taking into account the login type of the user if applicable.
EnsureLinkExternalToUser link the external user to the user.
ExistsWithAvatarAtStoragePath returns true if there is a user with this Avatar.
FixWrongUserType fix OrgUser who have wrong type.
FollowUser marks someone be another's follower.
GenerateRandomAvatar generates a random avatar for user.
GetAdminUser returns the first administrator.
GetAllUsers returns a slice of all individual users found in DB.
GetBadge returns a badge.
GetEmailAddressByID gets a user's email address by ID.
GetEmailAddresses returns all email addresses belongs to given user.
GetExternalLogin checks if a externalID in loginSourceID scope already exists.
GetInactiveUsers gets all inactive users.
GetMaileableUsersByIDs gets users from ids, but only if they can receive mails.
GetPossibleUserByID returns the user if id > 0 or return system usrs if id < 0.
GetPossibleUserByIDs returns the users if id > 0 or return system users if id < 0.
GetSetting returns the setting value via the key.
GetSettingNoCache returns specific setting without using the cache.
GetSettings returns specific settings from user.
GetUser checks if a user already exists.
GetUserAllSettings returns all settings from user.
GetUserBadges returns the user's badges.
GetUserByEmail returns the user object by given e-mail if exists.
GetUserByID returns the user object by given ID if exists.
GetUserByIDs returns the user objects by given IDs if exists.
GetUserByNameCtx returns user by given name.
GetUserByOpenID returns the user object by given OpenID if exists.
GetUserEmailsByNames returns a list of e-mails corresponds to names of users that have their email notifications set to enabled or onmention.
GetUserFollowers returns range of user's followers.
GetUserFollowing returns range of user's following.
GetUserIDByExternalUserID get user id according to provider and userID.
GetUserIDsByNames returns a slice of ids corresponds to names.
GetUserNameByID returns username for the id.
GetUserNamesByIDs returns usernames for all resolved users from a list of Ids.
GetUserOpenIDs returns all openid addresses that belongs to given user.
GetUserSalt returns a random user salt token.
GetUsersByIDs returns all resolved users from a list of Ids.
GetUsersBySource returns a list of Users for a login source.
GetUserSetting gets a specific setting for a user.
GetVerifyUser get user by verify code.
IsEmailActive check if email is activated with a different emailID.
IsEmailUsed returns true if the email has been used.
IsErrEmailAddressNotExist checks if an error is an ErrEmailAddressNotExist.
IsErrEmailAlreadyUsed checks if an error is a ErrEmailAlreadyUsed.
IsErrEmailCharIsNotSupported checks if an error is an ErrEmailCharIsNotSupported.
IsErrEmailInvalid checks if an error is an ErrEmailInvalid.
IsErrExternalLoginUserAlreadyExist checks if an error is a ExternalLoginUserAlreadyExist.
IsErrExternalLoginUserNotExist checks if an error is a ExternalLoginUserNotExist.
IsErrOpenIDAlreadyUsed checks if an error is a ErrOpenIDAlreadyUsed.
IsErrPrimaryEmailCannotDelete checks if an error is an ErrPrimaryEmailCannotDelete.
IsErrUserAlreadyExist checks if an error is a ErrUserAlreadyExists.
IsErrUserInactive checks if an error is a ErrUserInactive.
IsErrUserIsNotLocal.
IsErrUserNotExist checks if an error is a ErrUserNotExist.
IsErrUserProhibitLogin checks if an error is a ErrUserProhibitLogin.
IsErrUserRedirectNotExist check if an error is an ErrUserRedirectNotExist.
IsErrUserSettingIsNotExist return true if err is ErrSettingIsNotExist.
IsFeatureDisabledWithLoginType checks if a user features are disabled, taking into account the login type of the user if applicable.
IsFollowing returns true if user is following followID.
IsLastAdminUser check whether user is the last admin.
IsUsableUsername returns an error when a username is reserved.
IsUserExist checks if given user name exist, the user name should be noncased unique.
IsUserVisibleToViewer check if viewer is able to see user profile.
LinkExternalToUser link the external user to the user.
LookupUserRedirect look up userID if a user has a redirect name.
NewActionsUser creates and returns a fake user for running the actions.
NewGhostUser creates and returns a fake user for someone has deleted their account.
NewReplaceUser creates and returns a fake user for external user.
NewUserRedirect create a new user redirect.
NormalizeUserName only takes the name part if it is an email address, transforms it diacritics to ASCII characters.
RemoveAccountLink will remove all external login sources for the given user.
RemoveAllAccountLinks will remove all external login sources for the given user.
RemoveAllUserBadges removes all badges from a user.
RemoveUserBadge removes a badge from a user.
RemoveUserBadges removes badges from a user.
SearchEmails takes options i.e.
SearchUsers takes options i.e.
SetUserSetting updates a users' setting for a specific key.
ToggleUserOpenIDVisibility toggles visibility of an openid address of given user.
UnfollowUser unmarks someone as another's follower.
UpdateBadge updates a badge based on its slug.
UpdateExternalUserByExternalID updates an external user's information.
UpdateUserCols update user according special columns.
UserPath returns the path absolute path of user repositories.
ValidateCommitsWithEmails checks if authors' e-mails of commits are corresponding to users.
ValidateCommitWithEmail check if author's e-mail of commit is corresponding to a user.
ValidateEmail check if email is a valid & allowed address.
ValidateEmailForAdmin check if email is a valid address when admins manually add or edit users.
ValidateUser check if user is valid to insert / update into database.
VerifyActiveEmailCode verifies active email code when active account.
VerifyUserActiveCode verifies active code when active account.
# Constants
EmailNotificationsAndYourOwn indicates that the user would like to receive all email notifications and your own.
EmailNotificationsDisabled indicates that the user would not like to be notified via email.
EmailNotificationsEnabled indicates that the user would like to receive all email notifications except your own.
EmailNotificationsOnMention indicates that the user would like to be notified via email when mentioned.
Note: As of the beginning of 2022, it is recommended to use at least 64 bits of salt, but NIST is already recommending to use to 128 bits.
Strings for sorting result.
Strings for sorting result.
Strings for sorting result.
Strings for sorting result.
SettingsKeyDiffWhitespaceBehavior is the setting key for whitespace behavior of diff.
SettingsKeyHiddenCommentTypes is the setting key for hidden comment types.
SettingsKeyShowOutdatedComments is the setting key wether or not to show outdated comments in PRs.
SignupIP is the IP address that the user signed up with.
SignupUserAgent is the user agent that the user signed up with.
UserActivityPubPrivPem is user's private key.
UserActivityPubPubPem is user's public key.
4.
Historic reason to make it starts at 0.
1.
3.
5.
2.
# Variables
ErrOpenIDNotExist openid is not known.
# Structs
Badge represents a user badge.
CountUserFilter represent optional filters for CountUsers.
CreateUserOverwriteOptions are an optional options who overwrite system defaults on user creation.
EmailAddress is the list of all email addresses of a user.
ErrEmailAddressNotExist email address not exist.
ErrEmailAlreadyUsed represents a "EmailAlreadyUsed" kind of error.
ErrEmailCharIsNotSupported e-mail address contains unsupported character.
ErrEmailInvalid represents an error where the email address does not comply with RFC 5322 or has a leading '-' character.
ErrExternalLoginUserAlreadyExist represents a "ExternalLoginUserAlreadyExist" kind of error.
ErrExternalLoginUserNotExist represents a "ExternalLoginUserNotExist" kind of error.
ErrOpenIDAlreadyUsed represents a "OpenIDAlreadyUsed" kind of error.
ErrPrimaryEmailCannotDelete primary email address cannot be deleted.
ErrUserAlreadyExist represents a "user already exists" error.
ErrUserInactive represents a "ErrUserInactive" kind of error.
ErrUserIsNotLocal represents a "ErrUserIsNotLocal" kind of error.
ErrUserNotExist represents a "UserNotExist" kind of error.
ErrUserProhibitLogin represents a "ErrUserProhibitLogin" kind of error.
ErrUserRedirectNotExist represents a "UserRedirectNotExist" kind of error.
ErrUserSettingIsNotExist represents an error that a setting is not exist with special key.
ExternalLoginUser makes the connecting between some existing user and additional external login sources.
FindExternalUserOptions represents an options to find external users.
Follow represents relations of user and their followers.
Meta defines the meta information of a user, to be stored in the K/V table.
Redirect represents that a user name should be redirected to another.
SearchEmailOptions are options to search e-mail addresses for the admin panel.
SearchEmailResult is an e-mail address found in the user or email_address table.
SearchOrganizationsOptions options to filter organizations.
SearchUserOptions contains the options for searching.
Setting is a key value store of user settings.
User represents the object of individual and member of organization.
UserBadge represents a user badge.
UserCommit represents a commit with validation of user.
UserOpenID is the list of all OpenID identities of a user.
# Type aliases
SearchEmailOrderBy is used to sort the results from SearchEmails().
UserList is a list of user.
UserType defines the user type.