validation

package module
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2022 License: BSD-2-Clause Imports: 5 Imported by: 0

README

Input validation utilities

Features:

  • Chain multiple validation functions
  • Validate email address
  • Validate phone number
  • Validate number range
  • Validate string is UTF-8
  • Validate string length

Todo:

  • Re-design (CheckFunc should just return a boolean to report something that is then asserted for generate an error if needed)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(id string, checks ...CheckFunc) error

func CheckAll

func CheckAll(errs ...error) error

Types

type CheckFunc

type CheckFunc func() error

func IntIsAboveMin

func IntIsAboveMin(in, min int, intName string) CheckFunc

func IntIsBelowMax

func IntIsBelowMax(in, max int, intName string) CheckFunc

func IsEmailAddress

func IsEmailAddress(in string) CheckFunc

func IsEmailAddresses

func IsEmailAddresses(in []string) CheckFunc

func IsLongerThanString

func IsLongerThanString(in string, min int) CheckFunc

func IsNotEmpty

func IsNotEmpty(in string) CheckFunc

func IsNotEmptyStringSlice

func IsNotEmptyStringSlice(in []string) CheckFunc

func IsNotNil

func IsNotNil(in any) CheckFunc

func IsNotStrictlyLongerThanStringSlice

func IsNotStrictlyLongerThanStringSlice(maxlen int, in []string) CheckFunc

func IsPhoneNumber

func IsPhoneNumber(in string) CheckFunc

func IsStrictlyShorterThanString

func IsStrictlyShorterThanString(in string, max int) CheckFunc

Maximum is NOT included.

func IsUTF8

func IsUTF8(in string) CheckFunc

func IsWithinMinMaxString

func IsWithinMinMaxString(in string, min, max int) CheckFunc

Directories

Path Synopsis
examples
demo command

Jump to

Keyboard shortcuts

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