validate

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2018 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Description added in v0.26.0

func Description(input, fieldName string) error

Description validates whether the input meets the descriptin requirements

func Email

func Email(input string) error

Email validates whether the input is a valid email format

func InviteCode added in v0.30.0

func InviteCode(input string) error

InviteCode validates whether the input meets the invite code requirements

func Name

func Name(input string) error

Name validates whether the input meets first name last name requirements

func NewValidationError added in v0.30.0

func NewValidationError(msg string) error

NewValidationError returns a validation error

func Password

func Password(input string) error

Password ensures the input meets password requirements

func VerificationCode added in v0.30.0

func VerificationCode(input string) error

VerificationCode validates whether the input meets the verification code requirements

Types

type Func added in v0.30.0

Func represents a validation function

var OrgName Func

OrgName validates whether the input meets the org name requirements

var PolicyName Func

PolicyName validates whether the input meets the policy name requirements

var ProjectName Func

ProjectName validates whether the input meets the project name requirements

var RoleName Func

RoleName validates whether the input meets the role name requirements

var TeamName Func

TeamName validates whether the input meets the team name requirements

var Username Func

Username validates whether the input meets the username requirements

func ConfirmPassword added in v0.30.0

func ConfirmPassword(previous string) Func

ConfirmPassword ensures the input meets the password requirements and matches the previously provided password

func Confirmer added in v0.30.0

func Confirmer(defaultYes bool) Func

Confirmer returns a confirmation validation function which validates the input depending on whether or not this prompt is default Yes or No.

func OneOf added in v0.30.0

func OneOf(choices []string) Func

OneOf returns a validation function which validates whether or not the input matches one of the given options.

func SlugValidator added in v0.30.0

func SlugValidator(fieldName string) Func

SlugValidator returns a validation function

type ValidationError added in v0.30.0

type ValidationError struct {
	// contains filtered or unexported fields
}

ValidationError represents an error encountered when validating a field

func (*ValidationError) Error added in v0.30.0

func (e *ValidationError) Error() string

Error returns the error message completing the Error interface

Jump to

Keyboard shortcuts

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