Documentation ¶
Index ¶
- Constants
- func CheckEmail(email string) bool
- func ClearCookie(w http.ResponseWriter) (int, error)
- func CreateUser(w http.ResponseWriter, r *http.Request) (int, error)
- func CreateUserAuthentication(w http.ResponseWriter, r *http.Request) (int, error)
- func CreateUserFromForm(registrationForm formStruct.RegistrationForm) (model.User, error)
- func CurrentUser(r *http.Request) (model.User, error)
- func DecodeCookie(cookie_value string) (uint, error)
- func DeleteComment(id string) (int, error)
- func DeleteUser(w http.ResponseWriter, currentUser *model.User, id string) (int, error)
- func EmailVerification(token string, w http.ResponseWriter) (int, error)
- func EncodeCookie(user_id uint) (string, error)
- func FindOrCreateUser(username string) (model.User, int, error)
- func FindUserByUserName(userName string) (model.User, int, error)
- func RegisterHanderFromForm(w http.ResponseWriter, registrationForm formStruct.RegistrationForm) (int, error)
- func RegisterHandler(w http.ResponseWriter, r *http.Request) (int, error)
- func RemoveFollow(user *model.User, follower *model.User)
- func RetrieveCurrentUser(r *http.Request) (model.User, int, error)
- func RetrieveUser(r *http.Request, id string) (*model.PublicUser, bool, uint, int, error)
- func RetrieveUserByEmail(email string) (*model.PublicUser, string, int, error)
- func RetrieveUserByUsername(username string) (*model.PublicUser, string, int, error)
- func RetrieveUserForAdmin(id string) (model.User, int, error)
- func RetrieveUsers() []*model.PublicUser
- func RetrieveUsersByEmail(email string) []*model.PublicUser
- func RetrieveUsersForAdmin(limit int, offset int) ([]model.User, int)
- func SendEmailVerification(to string, token string, locale string) error
- func SendVerificationToUser(user model.User, newEmail string) (int, error)
- func SetCookieHandler(w http.ResponseWriter, email string, pass string) (int, error)
- func SetFollow(user *model.User, follower *model.User)
- func SuggestUsername(username string) string
- func UpdateUser(w http.ResponseWriter, form *formStruct.UserForm, currentUser *model.User, ...) (model.User, int, error)
- func UpdateUserCore(user *model.User) (int, error)
Constants ¶
const CookieName = "session"
Variables ¶
This section is empty.
Functions ¶
func CheckEmail ¶
func ClearCookie ¶
func ClearCookie(w http.ResponseWriter) (int, error)
func CreateUser ¶
CreateUser creates a user.
func CreateUserAuthentication ¶
CreateUserAuthentication creates user authentication.
func CreateUserFromForm ¶
func CreateUserFromForm(registrationForm formStruct.RegistrationForm) (model.User, error)
CreateUserFromForm creates a user from a registration form.
func CurrentUser ¶
CurrentUser determines the current user from the request
func DecodeCookie ¶
Encoding & Decoding of the cookie value
func DeleteComment ¶
func DeleteUser ¶
DeleteUser deletes a user.
func EmailVerification ¶
func EmailVerification(token string, w http.ResponseWriter) (int, error)
EmailVerification verifies the token used for email verification
func EncodeCookie ¶
func FindOrCreateUser ¶
FindOrCreateUser creates a user.
func FindUserByUserName ¶
FindUserByUserName creates a user.
func RegisterHanderFromForm ¶
func RegisterHanderFromForm(w http.ResponseWriter, registrationForm formStruct.RegistrationForm) (int, error)
RegisterHanderFromForm sets cookie from a RegistrationForm.
func RegisterHandler ¶
RegisterHandler sets a cookie when user registered.
func RetrieveCurrentUser ¶
RetrieveCurrentUser retrieves a current user.
func RetrieveUser ¶
RetrieveUser retrieves a user.
func RetrieveUserByEmail ¶
RetrieveUserByEmail retrieves a user by an email
func RetrieveUserByUsername ¶
RetrieveUserByUsername retrieves a user by username.
func RetrieveUserForAdmin ¶
RetrieveUserForAdmin retrieves a user for an administrator.
func RetrieveUsersByEmail ¶
func RetrieveUsersByEmail(email string) []*model.PublicUser
RetrieveUsersByEmail retrieves users by an email
func RetrieveUsersForAdmin ¶
RetrieveUsersForAdmin retrieves users for an administrator.
func SendEmailVerification ¶
SendEmailVerfication sends an email verification token via email.
func SendVerificationToUser ¶
SendVerificationToUser sends an email verification token to user.
func SetCookieHandler ¶
SetCookieHandler sets the authentication cookie
func SuggestUsername ¶
SuggestUsername suggest user's name if user's name already occupied.
func UpdateUser ¶
func UpdateUser(w http.ResponseWriter, form *formStruct.UserForm, currentUser *model.User, id string) (model.User, int, error)
UpdateUser updates a user.
Types ¶
This section is empty.