Documentation ¶
Index ¶
- func AddContact(user *tat.User, contactUsername string, contactFullname string) error
- func AddDefaultGroup(user *tat.User) error
- func AddFavoriteTag(user *tat.User, tag string) error
- func AddFavoriteTopic(user *tat.User, topic string) error
- func Archive(user *tat.User, userAdmin string) error
- func AskReset(user *tat.User) (string, error)
- func CheckDefaultGroup(user *tat.User, fixDefaultGroup bool) string
- func CheckTopics(user *tat.User, fixTopics bool) string
- func ConvertToAdmin(user *tat.User, userAdmin string) error
- func ConvertToSystem(user *tat.User, userAdmin string, canListUsersAsAdmin bool) (string, error)
- func CountUsers() (int, error)
- func CreatePrivateTopic(user *tat.User, subTopic string) error
- func DisableNotificationsAllTopics(user *tat.User) error
- func DisableNotificationsTopic(user *tat.User, topic string) error
- func EnableNotificationsAllTopics(user *tat.User) error
- func EnableNotificationsTopic(user *tat.User, topic string) error
- func FindByEmail(user *tat.User, email string) (bool, error)
- func FindByFullname(user *tat.User, fullname string) (bool, error)
- func FindByUsername(user *tat.User, username string) (bool, error)
- func FindByUsernameAndEmail(user *tat.User, username, email string) error
- func FindByUsernameAndPassword(user *tat.User, username, password string) (bool, error)
- func GenerateSalt() (string, error)
- func HashPassword(password, salt string) string
- func Insert(user *tat.User) (string, error)
- func ListUsers(criteria *tat.UserCriteria, isAdmin bool) (int, []tat.User, error)
- func RemoveContact(user *tat.User, contactUsername string) error
- func RemoveFavoriteTag(user *tat.User, tag string) error
- func RemoveFavoriteTopic(user *tat.User, topic string) error
- func Rename(user *tat.User, newUsername string) error
- func ResetSystemUserPassword(user *tat.User) (string, error)
- func SendAskResetEmail(username, to, tokenVerify, device string) error
- func SendVerifyEmail(username, to, tokenVerify, device string) error
- func TrustUsername(user *tat.User, username string) error
- func Update(user *tat.User, newFullname, newEmail string) error
- func UpdateSystemUser(user *tat.User, canListUsersAsAdmin bool) error
- func Verify(user *tat.User, username, tokenVerify string) (bool, string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddContact ¶
AddContact add a contact to user
func AddDefaultGroup ¶
AddDefaultGroup add default group to user
func AddFavoriteTag ¶
AddFavoriteTag Add a favorite tag to user
func AddFavoriteTopic ¶
AddFavoriteTopic add a favorite topic to user
func Archive ¶
Archive changes username of one user and set attribute email, username to random string
func AskReset ¶
AskReset generate a new saltTokenVerify / hashedTokenVerify return tokenVerify (to be sent to user by mail)
func CheckDefaultGroup ¶
CheckDefaultGroup check default group and creates it if fixDefaultGroup is true
func CheckTopics ¶
CheckTopics check default topics for user and creates them if fixTopics is true
func ConvertToAdmin ¶
ConvertToAdmin set attribute IsAdmin to true
func ConvertToSystem ¶
ConvertToSystem set attribute IsSysetm to true and suffix mail with a random string. If canListUsersAsAdmin is true, this system user can view all user's fields as an admin (email, etc...) returns password, err
func CreatePrivateTopic ¶
CreatePrivateTopic creates a Private Topic. Name of topic will be : /Private/username and if subTopic != "", it will be : /Private/username/subTopic CanUpdateMsg, CanDeleteMsg set to true
func DisableNotificationsAllTopics ¶
DisableNotificationsAllTopics add all topics to user list offNotificationsTopics, except /Private/*
func DisableNotificationsTopic ¶
DisableNotificationsTopic add topic to user list offNotificationsTopics
func EnableNotificationsAllTopics ¶
EnableNotificationsAllTopics removes all topics from user list offNotificationsTopics
func EnableNotificationsTopic ¶
EnableNotificationsTopic remove topic from user list offNotificationsTopics
func FindByEmail ¶
FindByEmail retrieve information from user with email
func FindByFullname ¶
FindByFullname retrieve information from user with fullname
func FindByUsername ¶
FindByUsername retrieve information from user with username
func FindByUsernameAndEmail ¶
FindByUsernameAndEmail retrieve information from user with username
func FindByUsernameAndPassword ¶
FindByUsernameAndPassword search username, use user's salt to generates hashedPassword and check username + hashedPassword in DB
func GenerateSalt ¶
GenerateSalt generates salt, 32 length, with rand.Reader
func HashPassword ¶
HashPassword hashes password, with given salt It uses sha512.Sum
func Insert ¶
Insert a new user, return tokenVerify to user, in order to validate account after check email
func RemoveContact ¶
RemoveContact removes a contact from user
func RemoveFavoriteTag ¶
RemoveFavoriteTag remove a favorite tag from user
func RemoveFavoriteTopic ¶
RemoveFavoriteTopic removes a favorite topic from user
func ResetSystemUserPassword ¶
ResetSystemUserPassword reset a password for a system user returns newPassword
func SendAskResetEmail ¶
SendAskResetEmail send a mail to user, ask him to confirm reset password
func SendVerifyEmail ¶
SendVerifyEmail send a mail to new user, ask him to valide his new account
func TrustUsername ¶
TrustUsername create user is not already registered
func UpdateSystemUser ¶
UpdateSystemUser updates flags CanListUsersAsAdmin
Types ¶
This section is empty.