userService

package
v0.0.0-...-5607d3c Latest Latest
Warning

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

Go to latest
Published: May 13, 2017 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const CookieName = "session"

Variables

This section is empty.

Functions

func CheckEmail

func CheckEmail(email string) bool

func ClearCookie

func ClearCookie(w http.ResponseWriter) (int, error)

func CreateUser

func CreateUser(w http.ResponseWriter, r *http.Request) (int, error)

CreateUser creates a user.

func CreateUserAuthentication

func CreateUserAuthentication(w http.ResponseWriter, r *http.Request) (int, error)

CreateUserAuthentication creates user authentication.

func CreateUserFromForm

func CreateUserFromForm(registrationForm formStruct.RegistrationForm) (model.User, error)

CreateUserFromForm creates a user from a registration form.

func CurrentUser

func CurrentUser(r *http.Request) (model.User, error)

CurrentUser determines the current user from the request

func DecodeCookie

func DecodeCookie(cookie_value string) (uint, error)

Encoding & Decoding of the cookie value

func DeleteComment

func DeleteComment(id string) (int, error)

func DeleteUser

func DeleteUser(w http.ResponseWriter, currentUser *model.User, id string) (int, error)

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 EncodeCookie(user_id uint) (string, error)

func FindOrCreateUser

func FindOrCreateUser(username string) (model.User, int, error)

FindOrCreateUser creates a user.

func FindUserByUserName

func FindUserByUserName(userName string) (model.User, int, error)

FindUserByUserName creates a user.

func RegisterHanderFromForm

func RegisterHanderFromForm(w http.ResponseWriter, registrationForm formStruct.RegistrationForm) (int, error)

RegisterHanderFromForm sets cookie from a RegistrationForm.

func RegisterHandler

func RegisterHandler(w http.ResponseWriter, r *http.Request) (int, error)

RegisterHandler sets a cookie when user registered.

func RemoveFollow

func RemoveFollow(user *model.User, follower *model.User)

func RetrieveCurrentUser

func RetrieveCurrentUser(r *http.Request) (model.User, int, error)

RetrieveCurrentUser retrieves a current user.

func RetrieveUser

func RetrieveUser(r *http.Request, id string) (*model.PublicUser, bool, uint, int, error)

RetrieveUser retrieves a user.

func RetrieveUserByEmail

func RetrieveUserByEmail(email string) (*model.PublicUser, string, int, error)

RetrieveUserByEmail retrieves a user by an email

func RetrieveUserByUsername

func RetrieveUserByUsername(username string) (*model.PublicUser, string, int, error)

RetrieveUserByUsername retrieves a user by username.

func RetrieveUserForAdmin

func RetrieveUserForAdmin(id string) (model.User, int, error)

RetrieveUserForAdmin retrieves a user for an administrator.

func RetrieveUsers

func RetrieveUsers() []*model.PublicUser

RetrieveUsers retrieves users.

func RetrieveUsersByEmail

func RetrieveUsersByEmail(email string) []*model.PublicUser

RetrieveUsersByEmail retrieves users by an email

func RetrieveUsersForAdmin

func RetrieveUsersForAdmin(limit int, offset int) ([]model.User, int)

RetrieveUsersForAdmin retrieves users for an administrator.

func SendEmailVerification

func SendEmailVerification(to string, token string, locale string) error

SendEmailVerfication sends an email verification token via email.

func SendVerificationToUser

func SendVerificationToUser(user model.User, newEmail string) (int, error)

SendVerificationToUser sends an email verification token to user.

func SetCookieHandler

func SetCookieHandler(w http.ResponseWriter, email string, pass string) (int, error)

SetCookieHandler sets the authentication cookie

func SetFollow

func SetFollow(user *model.User, follower *model.User)

func SuggestUsername

func SuggestUsername(username string) string

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.

func UpdateUserCore

func UpdateUserCore(user *model.User) (int, error)

UpdateUserCore updates a user. (Applying the modifed data of user).

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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