helper

package
v0.0.0-...-ee596be Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2019 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

CheckPasswordHash checks if the given password matches

func HashPassword

func HashPassword(password string, cost int) (string, error)

HashPassword encrypts a given password using bcrypt algorithm

func ValidatorMessage

func ValidatorMessage(c *gin.Context, err error)

ValidatorMessage validate error messages

Types

type APIMessage

type APIMessage struct {
	Message string `json:"message,omitempty"`
	Status  int    `json:"status,omitempty"`
}

APIMessage type is a struct for generic JSON response

type APIValidator

type APIValidator struct {
	Errors []APIMessage `json:"errors"`
}

APIValidator type is a struct for multiple error messages

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL