user

package
v0.0.0-...-e61ee7f Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddEmailAddresses

func AddEmailAddresses(ctx context.Context, u *user_model.User, emails []string) error

func AdminAddOrSetPrimaryEmailAddress

func AdminAddOrSetPrimaryEmailAddress(ctx context.Context, u *user_model.User, emailStr string) error

AdminAddOrSetPrimaryEmailAddress is used by admins to add or set a user's primary email address

func BlockUser

func BlockUser(ctx context.Context, doer, blocker, blockee *user_model.User, note string) error

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 DeleteAvatar

func DeleteAvatar(ctx context.Context, u *user_model.User) error

DeleteAvatar deletes the user's custom avatar.

func DeleteEmailAddresses

func DeleteEmailAddresses(ctx context.Context, u *user_model.User, emails []string) error

func DeleteInactiveUsers

func DeleteInactiveUsers(ctx context.Context, olderThan time.Duration) error

DeleteInactiveUsers deletes all inactive users and their email addresses.

func DeleteUser

func DeleteUser(ctx context.Context, u *user_model.User, purge bool) error

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) error

RenameUser renames a user

func ReplacePrimaryEmailAddress

func ReplacePrimaryEmailAddress(ctx context.Context, u *user_model.User, emailStr string) error

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 UpdateUser

func UpdateUser(ctx context.Context, u *user_model.User, opts *UpdateOptions) error

func UploadAvatar

func UploadAvatar(ctx context.Context, u *user_model.User, data []byte) error

UploadAvatar saves custom avatar for user.

Types

type UpdateAuthOptions

type UpdateAuthOptions struct {
	LoginSource        optional.Option[int64]
	LoginName          optional.Option[string]
	Password           optional.Option[string]
	MustChangePassword optional.Option[bool]
	ProhibitLogin      optional.Option[bool]
}

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[bool]
	EmailNotificationsPreference optional.Option[string]
	SetLastLogin                 bool
	RepoAdminChangeTeamAccess    optional.Option[bool]
}

Jump to

Keyboard shortcuts

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