Documentation
¶
Index ¶
- Constants
- Variables
- func Encode[T any](w http.ResponseWriter, status int, v T) error
- func EncodeError[T any](w http.ResponseWriter, status int, data T) error
- func EncodeValidationError(w http.ResponseWriter, ves validator.ValidationErrors)
- func GenerateSalt() ([]byte, error)
- func If[T any](cond bool, tval, fval T) T
- func IsPassword(hashed, password, salt []byte) bool
- func SaltyPassword(password, salt []byte) ([]byte, error)
- func ValidateReq[T any](w http.ResponseWriter, r *http.Request, vdt *validator.Validate, val *T) error
- type ConfigType
Constants ¶
View Source
const EnvPrefix string = "USER_AUTH"
Variables ¶
View Source
var ErrCouldNotHash error = errors.New("could generate hash of password")
Functions ¶
func EncodeError ¶
func EncodeError[T any](w http.ResponseWriter, status int, data T) error
func EncodeValidationError ¶
func EncodeValidationError(w http.ResponseWriter, ves validator.ValidationErrors)
func GenerateSalt ¶
func IsPassword ¶
func SaltyPassword ¶
func ValidateReq ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.