Documentation
¶
Index ¶
- func AddEmailAddresses(ctx context.Context, u *user_model.User, emails []string) error
- func BlockUser(ctx context.Context, doer, blocker, blockee *user_model.User, note string) error
- func CanBlockUser(ctx context.Context, doer, blocker, blockee *user_model.User) bool
- func CanUnblockUser(ctx context.Context, doer, blocker, blockee *user_model.User) bool
- func ChangePrimaryEmail(ctx context.Context, user *user_model.User, address string) (pending bool, err error)
- func DeleteAvatar(ctx context.Context, u *user_model.User) error
- func DeleteEmailAddresses(ctx context.Context, u *user_model.User, emails []string) error
- func DeleteInactiveUsers(ctx context.Context, olderThan time.Duration) error
- func DeleteUser(ctx context.Context, u *user_model.User, purge bool) error
- func RenameUser(ctx context.Context, u *user_model.User, newUserName string, ...) error
- func ReplacePrimaryEmailAddress(ctx context.Context, u *user_model.User, emailStr string) error
- func UnblockUser(ctx context.Context, doer, blocker, blockee *user_model.User) error
- func UpdateAuth(ctx context.Context, u *user_model.User, opts *UpdateAuthOptions) error
- func UpdateOptionFieldFromPtr[T any](value *T) optional.Option[UpdateOptionField[T]]
- func UpdateOptionFieldFromSync[T any](value T) optional.Option[UpdateOptionField[T]]
- func UpdateOptionFieldFromValue[T any](value T) optional.Option[UpdateOptionField[T]]
- func UpdateUser(ctx context.Context, u *user_model.User, opts *UpdateOptions) error
- func UploadAvatar(ctx context.Context, u *user_model.User, data []byte) error
- type UpdateAuthOptions
- type UpdateOptionField
- type UpdateOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddEmailAddresses ¶
func CanBlockUser ¶
func CanBlockUser(ctx context.Context, doer, blocker, blockee *user_model.User) bool
func CanUnblockUser ¶
func CanUnblockUser(ctx context.Context, doer, blocker, blockee *user_model.User) bool
func ChangePrimaryEmail ¶ added in v1.7.0
func ChangePrimaryEmail(ctx context.Context, user *user_model.User, address string) (pending bool, err error)
ChangePrimaryEmail keeps the old address as an alias so existing commits retain their attribution. With email confirmation enabled the new address must be activated before it can become primary.
func DeleteAvatar ¶
func DeleteAvatar(ctx context.Context, u *user_model.User) error
DeleteAvatar deletes the user's custom avatar.
func DeleteEmailAddresses ¶
func DeleteInactiveUsers ¶
DeleteInactiveUsers deletes all inactive users and their email addresses.
func DeleteUser ¶
DeleteUser completely and permanently deletes everything of a user, but issues/comments/pulls will be kept and shown as someone has been deleted, unless the user is younger than USER_DELETE_WITH_COMMENTS_MAX_DAYS.
func RenameUser ¶
func RenameUser(ctx context.Context, u *user_model.User, newUserName string, doer *user_model.User) error
RenameUser renames a user
func ReplacePrimaryEmailAddress ¶
ReplacePrimaryEmailAddress replaces the user's primary email address with the given email address. It also updates the user's email field to match the new primary email address.
func UnblockUser ¶
func UnblockUser(ctx context.Context, doer, blocker, blockee *user_model.User) error
func UpdateAuth ¶
func UpdateAuth(ctx context.Context, u *user_model.User, opts *UpdateAuthOptions) error
func UpdateOptionFieldFromPtr ¶
func UpdateOptionFieldFromPtr[T any](value *T) optional.Option[UpdateOptionField[T]]
func UpdateOptionFieldFromSync ¶
func UpdateOptionFieldFromSync[T any](value T) optional.Option[UpdateOptionField[T]]
func UpdateOptionFieldFromValue ¶
func UpdateOptionFieldFromValue[T any](value T) optional.Option[UpdateOptionField[T]]
func UpdateUser ¶
func UpdateUser(ctx context.Context, u *user_model.User, opts *UpdateOptions) error
func UploadAvatar ¶
UploadAvatar saves custom avatar for user.
Types ¶
type UpdateAuthOptions ¶
type UpdateOptionField ¶
type UpdateOptions ¶
type UpdateOptions struct {
KeepEmailPrivate optional.Option[bool]
FullName optional.Option[string]
Website optional.Option[string]
Location optional.Option[string]
Description optional.Option[string]
AllowGitHook optional.Option[bool]
AllowImportLocal optional.Option[bool]
MaxRepoCreation optional.Option[int]
IsRestricted optional.Option[bool]
Visibility optional.Option[structs.VisibleType]
KeepActivityPrivate optional.Option[bool]
Language optional.Option[string]
Theme optional.Option[string]
DiffViewStyle optional.Option[string]
AllowCreateOrganization optional.Option[bool]
IsActive optional.Option[bool]
IsAdmin optional.Option[UpdateOptionField[bool]]
EmailNotificationsPreference optional.Option[string]
SetLastLogin bool
RepoAdminChangeTeamAccess optional.Option[bool]
}