Documentation ¶
Overview ¶
github.com/bartmika/mulberry-server/pkg/utils/jwt.go
github.com/bartmika/mulberry-server/pkg/utils/password.go
Index ¶
- func CheckPasswordHash(password, hash string) bool
- func ConnectDB(...) (*sql.DB, error)
- func GenerateJWTTokenPair(hmacSecret []byte, uuid string, d time.Duration) (string, string, error)
- func HashPassword(password string) (string, error)
- func JsonPrettyPrint(in string) string
- func ProcessJWTToken(hmacSecret []byte, reqToken string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPasswordHash ¶
Function checks the plaintext string and hash string and returns either true or false depending.
func GenerateJWTTokenPair ¶
Generate the `access token` and `refresh token` for the secret key.
func HashPassword ¶
Function takes the plaintext string and returns a hash string.
func JsonPrettyPrint ¶
Utility function nicely prints string data of JSON formatted contents. SOURCE: https://stackoverflow.com/a/36544455
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.