validate

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: MIT Imports: 6 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clamp

func Clamp(value, max, min uint) uint

Clamp a value to a max and min

func ValidateParam

func ValidateParam(param string) (id uint, err error)

ValidateParam will parse parameters from requests to see if they are uint or too huge

func ValidateParams

func ValidateParams() gin.HandlerFunc

ValidateParams will loop through the route parameters to make sure theyre uint

Types

type Validate

type Validate struct {
	Input string
	Max   int
	Min   int
}

Validate will check string length

func (*Validate) IsEmpty

func (v *Validate) IsEmpty() bool

IsEmpty checks to see if string is empty

func (*Validate) MaxLength

func (v *Validate) MaxLength() bool

MaxLength checks string for length

func (*Validate) MinLength

func (v *Validate) MinLength() bool

MinLength checks string for length

func (*Validate) MinPartsLength

func (v *Validate) MinPartsLength() bool

MinPartsLength will check if the entire string is less than the defined minimum

Jump to

Keyboard shortcuts

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