user

package
v0.0.0-...-9d12082 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Reset_Password_Expired int64 = 64

Functions

func ChangePassword

func ChangePassword(c echo.Context) error

func CreateUser

func CreateUser(c echo.Context) error

CreateUser is used to create a new user

func DeleteUser

func DeleteUser(c echo.Context) error

DeleteUser is used to delete user by ID

func Developer

func Developer(c echo.Context) error

func ForgotPassword

func ForgotPassword(c echo.Context) error

func GetAll

func GetAll(c echo.Context) error

GetAll is used to get all users using query params to offset/limit/sort (pagination) sortKeys := []string{"email", "name", "role", "created_at", "updated_at"} sortValues := []string{"asc", "desc"}

func GetAllRBAC

func GetAllRBAC(c echo.Context) error

func GetUser

func GetUser(c echo.Context) error

GetUser is used to get one user detail by ID

func GetUserRBAC

func GetUserRBAC(c echo.Context) error

func HashPassword

func HashPassword(pw string) (string, error)

HashPassword is used to hash user password using bcrypt

func Login

func Login(c echo.Context) error

Login is used to login user in If email and password are correct, response token and user role Otherwise, response bad request

func ResetPassword

func ResetPassword(c echo.Context) error

func Router

func Router(e *echo.Echo)

func ToggleUserActive

func ToggleUserActive(c echo.Context) error

func UpdateUser

func UpdateUser(c echo.Context) error

EditUser is used to edit user information by ID Allow update values: name, email, username, timezone password and role will be update in other API endpoint because of security reason!

func UpdateUserRole

func UpdateUserRole(c echo.Context) error

func Validate

func Validate(u *User) (bool, string)

func ValidateField

func ValidateField(field string, fieldType string) (bool, string)

func ValidateWithoutPassword

func ValidateWithoutPassword(u *User) (bool, string)

Types

type PasswordReset

type PasswordReset = model.PasswordReset

type User

type User = model.User

Jump to

Keyboard shortcuts

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