Documentation ¶
Index ¶
- Variables
- func GenerateEmailVerificationToken(email string) (string, error)
- func GenerateRenewPasswordToken(email string) (string, error)
- func GetAuthMiddleware() (*jwt.GinJWTMiddleware, error)
- func ValidateEmailVerificationToken(token string) (string, error)
- func ValidateRenewPasswordToken(token string) (string, error)
- type CreateUserParams
- type CreateUserResponse
- type LoginParams
- type RenewPasswordParams
- type ResendVerificationEmailParams
- type RetrieveUserResponse
- type SendRenewPasswordEmailParams
- type User
- type UserController
- func (uc *UserController) CreateUser(c *gin.Context, params CreateUserParams) (int, interface{})
- func (uc *UserController) RenewPassword(c *gin.Context, params RenewPasswordParams) (int, interface{})
- func (uc *UserController) ResendVerificationEmail(c *gin.Context, params ResendVerificationEmailParams) (int, interface{})
- func (uc *UserController) RetrieveUser(c *gin.Context) (int, interface{})
- func (uc *UserController) SendRenewPasswordEmail(c *gin.Context, params SendRenewPasswordEmailParams) (int, interface{})
- func (uc *UserController) VerificateUser(c *gin.Context, params VerificateUserParams) (int, interface{})
- type UserRouter
- func (r *UserRouter) CreateUser(c *gin.Context)
- func (r *UserRouter) RenewPassword(c *gin.Context)
- func (r *UserRouter) ResendVerificationEmail(c *gin.Context)
- func (r *UserRouter) RetrieveUser(c *gin.Context)
- func (r *UserRouter) SendRenewPasswordEmail(c *gin.Context)
- func (r *UserRouter) VerificateUser(c *gin.Context)
- type UserStore
- func (s *UserStore) Count(cond map[string]interface{}) (uint, error)
- func (s *UserStore) Create(usr User) (User, error)
- func (s *UserStore) Find() ([]User, error)
- func (s *UserStore) First(cond map[string]interface{}) (User, error)
- func (s *UserStore) Update(userID uint, fields map[string]interface{}) error
- type VerificateUserParams
- type VerificateUserResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrIncorrectEmailOrPassword = errors.New("Incorrect Email or Password!") ErrEmailIsNotVerifiedYet = errors.New("Your email is not verified yet.") ErrLoginsNotOpenedYet = errors.New("Email is verified, you will be allowed to login once the contest starts.") )
View Source
var IdentityKey = "email"
Functions ¶
func GetAuthMiddleware ¶
func GetAuthMiddleware() (*jwt.GinJWTMiddleware, error)
Types ¶
type CreateUserParams ¶
type CreateUserResponse ¶
type CreateUserResponse struct {
UserID uint `json:"user_id"`
}
type LoginParams ¶
type RenewPasswordParams ¶
type ResendVerificationEmailParams ¶
type ResendVerificationEmailParams struct {
Email string `json:"email" binding:"required,email"`
}
type RetrieveUserResponse ¶
type SendRenewPasswordEmailParams ¶
type SendRenewPasswordEmailParams struct {
Email string `json:"email" binding:"required,email"`
}
type User ¶
type User struct { gorm.Model Email string TeamName string Password string VerificationToken string RenewPasswordToken string IsVerified bool }
func (*User) CheckPassword ¶
type UserController ¶
type UserController struct{}
func (*UserController) CreateUser ¶
func (uc *UserController) CreateUser(c *gin.Context, params CreateUserParams) (int, interface{})
func (*UserController) RenewPassword ¶
func (uc *UserController) RenewPassword(c *gin.Context, params RenewPasswordParams) (int, interface{})
func (*UserController) ResendVerificationEmail ¶
func (uc *UserController) ResendVerificationEmail(c *gin.Context, params ResendVerificationEmailParams) (int, interface{})
func (*UserController) RetrieveUser ¶
func (uc *UserController) RetrieveUser(c *gin.Context) (int, interface{})
func (*UserController) SendRenewPasswordEmail ¶
func (uc *UserController) SendRenewPasswordEmail(c *gin.Context, params SendRenewPasswordEmailParams) (int, interface{})
func (*UserController) VerificateUser ¶
func (uc *UserController) VerificateUser(c *gin.Context, params VerificateUserParams) (int, interface{})
type UserRouter ¶
type UserRouter struct {
// contains filtered or unexported fields
}
func (*UserRouter) CreateUser ¶
func (r *UserRouter) CreateUser(c *gin.Context)
func (*UserRouter) RenewPassword ¶
func (r *UserRouter) RenewPassword(c *gin.Context)
func (*UserRouter) ResendVerificationEmail ¶
func (r *UserRouter) ResendVerificationEmail(c *gin.Context)
func (*UserRouter) RetrieveUser ¶
func (r *UserRouter) RetrieveUser(c *gin.Context)
func (*UserRouter) SendRenewPasswordEmail ¶
func (r *UserRouter) SendRenewPasswordEmail(c *gin.Context)
func (*UserRouter) VerificateUser ¶
func (r *UserRouter) VerificateUser(c *gin.Context)
type UserStore ¶
type UserStore struct {
// contains filtered or unexported fields
}
func NewUserStore ¶
func NewUserStore() UserStore
type VerificateUserParams ¶
type VerificateUserParams struct {
Token string `form:"token" binding:"required"`
}
type VerificateUserResponse ¶
Click to show internal directories.
Click to hide internal directories.