Documentation ¶
Index ¶
- Constants
- func CheckPasswordHash(password, hash string) bool
- func ConnectDB(...) (*sql.DB, error)
- func DumpRequest(writer io.Writer, header string, r *http.Request) error
- func GenerateJWTTokenPair(hmacSecret []byte, uuid string, d time.Duration) (string, string, error)
- func HashPassword(password string) (string, error)
- func HashPasswordAlgorithm() string
- func JavascriptISOStringToTime(s string) (time.Time, error)
- func JsonPrettyPrint(in string) string
- func ProcessJWTToken(hmacSecret []byte, reqToken string) (string, error)
- func RandomBase16String(l int) string
- func RandomBase64String(l int) string
Constants ¶
View Source
const JavascriptISOString = "2006-01-02T15:04:05.999Z07:00"
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 ¶
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 HashPasswordAlgorithm ¶
func HashPasswordAlgorithm() string
Function returns the algorithm used for hashing.
func JavascriptISOStringToTime ¶
JavascriptISOStringToTime is a utility function which will take a string formatted using the Javascript `toUTCString()` function and return a Golang time object.
func JsonPrettyPrint ¶
Code provided by https://stackoverflow.com/a/36544455
func ProcessJWTToken ¶
ProcessJWTToken validates either the `access token` or `refresh token` and returns either the `uuid` if success or error on failure.
func RandomBase16String ¶
func RandomBase64String ¶
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.