validate

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

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

Go to latest
Published: Sep 13, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Alphanumeric

func Alphanumeric(s string) bool

Alphanumeric validates whether a string is an alphanumeric string.

func AlphanumericExt

func AlphanumericExt(s string) bool

AlphanumericExt validates whether a string is an alphanumeric string, but a small set of extra characters allowed

func Integer

func Integer(n string) bool

Integer validates whether a string is an integer string.

func URL

func URL(url string) bool

URL validates whether a string is an URL string.

func UnixPath

func UnixPath(path string) bool

UnixPath validates whether a string is an unix path string.

Types

type Argument

type Argument struct {
	Name     string
	Validate String
}

Argument contains the name of the validation type and the validation function.

type String

type String func(string) bool

String is the validation function used for checking whether a string is valid or not.

func (String) TypeName

func (s String) TypeName() string

TypeName returns the type expected to be validated by the validate.String function.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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