userservice

package
v0.2.16 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearUserPublicProfileCache added in v0.2.15

func ClearUserPublicProfileCache()

func CloseUpdateUserLastActiveTime added in v0.0.7

func CloseUpdateUserLastActiveTime() error

CloseUpdateUserLastActiveTime stops the global activity cache and flushes current activity.

func CreateUser added in v0.0.9

func CreateUser(username, password, email string, needValid bool) (*users.EntityComplete, error)

func FirstUserInit

func FirstUserInit(adminUser *users.EntityComplete)

func GenerateGooseNickname added in v0.0.9

func GenerateGooseNickname() string

GenerateGooseNickname creates a compact random default nickname.

func GetUserCard added in v0.2.15

func GetUserCard(userID uint64) (*vo.UserCard, bool)

func GetUserHoverCard added in v0.2.15

func GetUserHoverCard(userID uint64) (*vo.UserHoverCard, bool)

func GetUserRoleId added in v0.2.15

func GetUserRoleId(userID uint64) (uint64, bool)

func GetUserShow added in v0.2.15

func GetUserShow(userID uint64) *vo.UserInfoShow

func GetWelcomeArticleContent added in v0.2.15

func GetWelcomeArticleContent() string

func InvalidateUserPublicProfileCache added in v0.2.15

func InvalidateUserPublicProfileCache(userID uint64)

func RefreshUserCaches added in v0.2.15

func RefreshUserCaches(userEntity *users.EntityComplete)

func SaveUser added in v0.2.11

func SaveUser(userEntity *users.EntityComplete) error

func UpdateUserActivity added in v0.0.7

func UpdateUserActivity(userID uint64)

UpdateUserActivity queues a global user activity update.

func UpdateUserActivityAt added in v0.2.9

func UpdateUserActivityAt(userID uint64, activeTime time.Time)

Types

type UserInfo added in v0.2.15

type UserInfo struct {
	Id                  uint64
	Username            string
	Email               string
	IsFrozen            int8
	IsActivated         int8
	ActivatedAt         *time.Time
	Nickname            string
	RoleId              uint64
	Prestige            int64
	AvatarUrl           string
	Bio                 string
	Signature           string
	WebsiteName         string
	Website             string
	ExternalInformation users.ExternalInformation
	CreatedAt           time.Time
	UpdatedAt           time.Time
}

UserInfo is the sanitized user snapshot cached by userservice. It intentionally excludes password hashes and model-only deletion metadata.

func GetUserInfo added in v0.2.15

func GetUserInfo(userID uint64) (UserInfo, bool)

type UserPublicInfo added in v0.2.15

type UserPublicInfo struct {
	Id                  uint64
	Username            string
	Nickname            string
	RoleId              uint64
	AvatarUrl           string
	Bio                 string
	Signature           string
	WebsiteName         string
	Website             string
	ExternalInformation users.ExternalInformation
	CreatedAt           time.Time
}

UserPublicInfo contains only fields needed by public display surfaces.

type UserPublicProfile added in v0.2.15

type UserPublicProfile struct {
	User   UserPublicInfo
	Stats  userStatistics.Entity
	Badges []badgeservice.UserBadge
}

func GetUserPublicProfile added in v0.2.15

func GetUserPublicProfile(userID uint64) (UserPublicProfile, bool)

Jump to

Keyboard shortcuts

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