vl

package module
v0.0.0-...-4f260db Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 9 Imported by: 1

README

vl

Go Reference Go Report Card

Go validation.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(f *frm.Field, inp ...string)

Bool validates inp as a boolean field.

func DateTime

func DateTime(f *frm.Field, inp ...string)

DateTime validates inp as a time.Time input.

func FileReq

func FileReq(f *frm.Field, inp ...string)

FileReq validates as a file required field.

func Float32

func Float32(f *frm.Field, inp ...string)

Float32 validates inp as a float32 input.

func Float64

func Float64(f *frm.Field, inp ...string)

Float64 validates inp as a float64 input

func IsValid

func IsValid(urlValues url.Values, fields []frm.Field) ([]frm.Field, bool)

IsValid loops through each form field and validates with a function from vl.

func IsValidRequest

func IsValidRequest(r *http.Request, fields []frm.Field) ([]frm.Field, bool)

IsValidRequest gathers the form submitted from GET and POST requests and then calls IsValid().

func Regex

func Regex(f *frm.Field, inp ...string)

Regex validates inp as an input with a regular expression check.

func RegexReq

func RegexReq(f *frm.Field, inp ...string)

RegexReq validates with Regex() as a required field.

func Str

func Str(f *frm.Field, inp ...string)

Str validates inp as a string input.

func StrOpt

func StrOpt(f *frm.Field, inp ...string)

StrOpt validates inp as a string array. Check value matches one of the options (optional).

func StrReq

func StrReq(f *frm.Field, inp ...string)

StrReq validates inp as a required string input.

func Uint

func Uint(f *frm.Field, inp ...string)

Uint validates inp as an unsigned integer.

func Uint8

func Uint8(f *frm.Field, inp ...string)

Uint8 validates inp as an unsigned 8-bit integer.

func Uint8List

func Uint8List(f *frm.Field, inp ...string)

Uint8List validates inp as a slice of unsigned 8-bit integers.

func Uint8Opt

func Uint8Opt(f *frm.Field, inp ...string)

Uint8Opt unsigned 8-bit integer option slice.

func Uint8Req

func Uint8Req(f *frm.Field, inp ...string)

Uint8Req enforces an unsigned 8-bit integer to be required.

func Uint16

func Uint16(f *frm.Field, inp ...string)

Uint16 validates inp as an unsigned 16-bit integer.

func Uint16List

func Uint16List(f *frm.Field, inp ...string)

Uint16List validates inp as a slice of unsigned 16-bit integers.

func Uint16Opt

func Uint16Opt(f *frm.Field, inp ...string)

Uint16Opt unsigned 16-bit integer option slice.

func Uint16Req

func Uint16Req(f *frm.Field, inp ...string)

Uint16Req enforces an unsigned 16-bit integer to be required.

func Uint32

func Uint32(f *frm.Field, inp ...string)

Uint32 validates inp as an unsigned 32-bit integer.

func Uint32List

func Uint32List(f *frm.Field, inp ...string)

Uint32List validates inp as a slice of unsigned 32-bit integers.

func Uint32Opt

func Uint32Opt(f *frm.Field, inp ...string)

Uint32Opt unsigned 32-bit integer option slice.

func Uint32Req

func Uint32Req(f *frm.Field, inp ...string)

Uint32Req enforces an unsigned 32-bit integer to be required.

func Uint64

func Uint64(f *frm.Field, inp ...string)

Uint64 validates inp as an unsigned 64-bit integer.

func Uint64List

func Uint64List(f *frm.Field, inp ...string)

Uint64List validates inp as a slice of unsigned 64-bit integers.

func Uint64Opt

func Uint64Opt(f *frm.Field, inp ...string)

Uint64Opt unsigned 64-bit integer option slice.

func Uint64Req

func Uint64Req(f *frm.Field, inp ...string)

Uint64Req enforces an unsigned 64-bit integer to be required.

func UintList

func UintList(f *frm.Field, inp ...string)

UintList validates inp as a slice of unsigned integers.

func UintOpt

func UintOpt(f *frm.Field, inp ...string)

UintOpt unsigned integer option slice.

func UintReq

func UintReq(f *frm.Field, inp ...string)

UintReq enforces an unsigned integer to be required.

Types

This section is empty.

Jump to

Keyboard shortcuts

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