Documentation
¶
Index ¶
- func AdminIndex(w http.ResponseWriter, r *http.Request)
- func CheckPass(password string, hash string) bool
- func CreateRouter()
- func GenerateJWT(email string, role string) (string, error)
- func GeneratePass(password string) (string, error)
- func InitializeRoute()
- func SignIn(w http.ResponseWriter, r *http.Request)
- func SignUp(w http.ResponseWriter, r *http.Request)
- func StartServer()
- func UserIndex(w http.ResponseWriter, r *http.Request)
- type Authentication
- type Error
- type Token
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdminIndex ¶
func AdminIndex(w http.ResponseWriter, r *http.Request)
func GenerateJWT ¶
Generate JWT Token based in the email and in the role as input. Creates a token by the algorithm signing method (HS256) and adds authorized email, role, and exp into claims. Claims are pieces of info added into the tokens.
func GeneratePass ¶
Generate Password from a Hash
func InitializeRoute ¶
func InitializeRoute()
InitializeRoute creates handlers for the mux Router to handle
func SignIn ¶
func SignIn(w http.ResponseWriter, r *http.Request)
SignIn function that checks if the user is present in the system, and check the key:values stored in the database. After compares the values from input and output and if its ok, generates a Golang JWT authentication
func StartServer ¶
func StartServer()
Types ¶
type Authentication ¶
Authentication is for login data
Click to show internal directories.
Click to hide internal directories.