Documentation ¶
Index ¶
- func CheckPasswordHash(password, hash string) bool
- func ChiperDecrypt(encryptedString string, keyString string) (string, error)
- func ChiperEncrypt(stringToEncrypt string, keyString string) (string, error)
- func ContainsString(s []string, str string) bool
- func HashPassword(password string) (string, error)
- func MapQueryParams(r *http.Request, data interface{}) error
- func ParseTemplate(templateFileName string, data interface{}) (string, error)
- func RespondWithError(w http.ResponseWriter, code int, errors []error)
- func RespondWithJSON(w http.ResponseWriter, code int, payload interface{})
- func ResponseWithJsonMeta(w http.ResponseWriter, code int, payload interface{}, meta interface{})
- func TimeUTC() time.Time
- func TimestampToTime(s string) time.Time
- type MetaResponse
- type StandardJwtClaims
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChiperDecrypt ¶
decrypt data using aes https://www.melvinvivas.com/how-to-encrypt-and-decrypt-data-using-aes
func ChiperEncrypt ¶
encrypt data using aes https://www.melvinvivas.com/how-to-encrypt-and-decrypt-data-using-aes
func ContainsString ¶
Contains reports whether substr is within s.
func ParseTemplate ¶
ref: https://github.com/Golang-Coach/Lessons/blob/master/GoMailer/template_helper.go
func RespondWithError ¶
func RespondWithError(w http.ResponseWriter, code int, errors []error)
func RespondWithJSON ¶
func RespondWithJSON(w http.ResponseWriter, code int, payload interface{})
func ResponseWithJsonMeta ¶
func ResponseWithJsonMeta(w http.ResponseWriter, code int, payload interface{}, meta interface{})
func TimestampToTime ¶
Types ¶
type MetaResponse ¶
type StandardJwtClaims ¶
type StandardJwtClaims struct { Audience string `json:"aud,omitempty"` ExpiresAt int64 `json:"exp,omitempty"` Id string `json:"jti,omitempty"` IssuedAt int64 `json:"iat,omitempty"` Issuer string `json:"iss,omitempty"` NotBefore int64 `json:"nbf,omitempty"` Subject string `json:"sub,omitempty"` Name string `json:"name,omitempty"` }
func DecodeJwtToken ¶
func DecodeJwtToken(token string) (claims *StandardJwtClaims, err error)
Click to show internal directories.
Click to hide internal directories.