validation

package
v0.0.0-...-0cf49f2 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2015 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

Types

This section is empty.

Jump to

Keyboard shortcuts

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