validation

package
v0.0.0-...-9451de5 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2019 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package validation provide utilities functions for data validation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateEmail

func ValidateEmail(email string) bool

func ValidateLength

func ValidateLength(value string, min, max int) bool

ValidateLength checks whether the given data match the given rules.

It checks if the value has more or equal `min` chars and less or equal `max` chars. If you don't want to check both, just pass a zero value:

ValidateLength(value, 0, 100) // Checks if value has at most 100 characters
ValidateLength(value, 100, 0) // Checks if value has at least 100 characters
ValidateLength(value, 20, 100) // Checks if value has at least 20 characters and at most 100 characters

func ValidateName

func ValidateName(name string) bool

ValidateName checks wether the given data contains at most 40 characters containing only lower case letters, numbers or dashes and starts with a letter

Types

This section is empty.

Jump to

Keyboard shortcuts

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