Documentation
¶
Index ¶
- func CustomAvatarPath(userID int64) string
- func DashboardURLPath(name string, isOrganization bool) string
- func EncodePassword(password, salt string) string
- func GenerateActivateCode(userID int64, email, name, password, rands string) string
- func GenerateRandomAvatar(userID int64, name, email string) error
- func MailResendCacheKey(userID int64) string
- func RandomSalt() (string, error)
- func SaveAvatar(userID int64, data []byte) error
- func TwoFactorCacheKey(userID int64, passcode string) string
- func ValidatePassword(encoded, salt, password string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CustomAvatarPath ¶
CustomAvatarPath returns the absolute path of the user custom avatar file.
func DashboardURLPath ¶
DashboardURLPath returns the URL path to the user or organization dashboard.
func EncodePassword ¶
EncodePassword encodes password using PBKDF2 SHA256 with given salt.
func GenerateActivateCode ¶
GenerateActivateCode generates an activate code based on user information and the given email.
func GenerateRandomAvatar ¶
GenerateRandomAvatar generates a random avatar and stores to local file system using given user information.
func MailResendCacheKey ¶
MailResendCacheKey returns the key used for caching mail resend.
func RandomSalt ¶
RandomSalt returns randomly generated 10-character string that can be used as the user salt.
func SaveAvatar ¶
SaveAvatar saves the given avatar for the user.
func TwoFactorCacheKey ¶
TwoFactorCacheKey returns the key used for caching two factor passcode.
func ValidatePassword ¶
ValidatePassword returns true if the given password matches the encoded version with given salt.
Types ¶
This section is empty.