validator

package
v0.0.0-...-44a091e Latest Latest
Warning

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

Go to latest
Published: May 15, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

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

func GetAlreadyExistsMessage(field string) string

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

func GetDoesNotExistMessage(field string) string

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

func GetIncorrectMessage(field string) string

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

func GetInvalidTokenMessage(field string) string

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.

Jump to

Keyboard shortcuts

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