Documentation ¶
Overview ¶
Package validator provides a function to validate structs according to the validations provided in the struct tags
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAlreadyExistsMessage ¶
GetAlreadyExistsMessage returns a string that can be returned back to the user as a feedback message to tell them that an entry with that value already exists
func GetDoesNotExistMessage ¶
GetDoesNotExistMessage returns a string that can be returned back to the user as a feedback message to tell them that an entry with that value does not exist
func GetIncorrectMessage ¶
GetIncorrectMessage returns a string that can be returned back to the user as a feedback message to tell them that the value they entered is incorrect
func GetInvalidTokenMessage ¶
GetInvalidTokenMessage returns a string that can be returned back to the user as a feedback message to tell them that the value they entered is not a valid token
func Validate ¶
func Validate(toValidate interface{}) []*model.FieldError
Validate takes a struct as an argument and runs some validation checks on it that are specified on that struct in the tags
Types ¶
This section is empty.