valida

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2020 License: MIT Imports: 6 Imported by: 0

README

valida

Build Status Coverage Status Go Report Card

Getting started

import valida

import "github.com/martinusso/valida"

Get the first error:

	err := Forge("valid@email.com").
		AllowEmpty().
		Email(expected).
		Assert()

Get all errors:

	err := Forge("valid@email.com").
		AllowEmpty().
		Email(expected).
		Errors()

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains added in v0.2.0

func Contains(arr []string, s string) bool

func Document

func Document(docType DocumentType, value string) bool

func Email

func Email(s string) bool

func Empty

func Empty(s string) bool

func Forge

func Forge(value interface{}) validator

func Max

func Max(value, length int) bool

func MaxLength

func MaxLength(value string, length int) bool

func Min

func Min(value, length int) bool

func MinLength

func MinLength(value string, length int) bool

func Password

func Password(s string) bool

func URL added in v0.3.0

func URL(value string) bool

Types

type DocumentType

type DocumentType string
const (
	BrazilCNPJ DocumentType = "brazil/cnpj"
	BrazilCPF  DocumentType = "brazil/cpf"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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