Validate

package module
v0.0.0-...-b57f35d Latest Latest
Warning

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

Go to latest
Published: May 16, 2016 License: MIT Imports: 2 Imported by: 1

README

##Command line tool for scanning value and validating a value.

###Install

go get github.com/Snaphy-Cloud/Validate

###Example //Scanning an Input email and checking its validity GetInput(&email, "Enter email address ", func(email string)(message string, isValid bool){ return "Email must be a valid one", IsEmail(email) })

###Documentation

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInput

func GetInput(value *string, message string, validFn Validate)

Accept as value from CLI and validate func which must return true to proceed..

    Example
    GetInput(&id, "Enter user Id: ", func(value string)(message string, isValid bool){
	return "User Id must be a number", IsNumeric(value)

    })

Types

type Validate

type Validate func(value string) (message string, isValid bool)

Defining a validate function which return a isValid and message

Jump to

Keyboard shortcuts

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