validate

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Alpha

func Alpha(s string) (string, error)

func Alphanumeric

func Alphanumeric(s string) (string, error)

func CompilePattern added in v0.0.8

func CompilePattern(pattern string) (*regexp.Regexp, error)

func Contains

func Contains(s string, substr string) (string, error)

func Email

func Email(s string) (string, error)

func EndsWith

func EndsWith(s string, suffix string) (string, error)

func InRange

func InRange(n int, min int, max int) (int, error)

func InRangeFloat

func InRangeFloat(n float64, min float64, max float64) (float64, error)

func Length

func Length(s string, n int) (string, error)

func LengthBetween

func LengthBetween(s string, min int, max int) (string, error)

func ListMaxLength

func ListMaxLength(items []any, n int) ([]any, error)

func ListMinLength

func ListMinLength(items []any, n int) ([]any, error)

func Matches

func Matches(s string, pattern string) (string, error)

func MatchesCompiled added in v0.0.8

func MatchesCompiled(s string, r *regexp.Regexp) (string, error)

func Max

func Max(n int, max int) (int, error)

func MaxLength

func MaxLength(s string, n int) (string, error)

func Min

func Min(n int, min int) (int, error)

func MinLength

func MinLength(s string, n int) (string, error)

func Negative

func Negative(n int) (int, error)

func NoHTML added in v0.0.8

func NoHTML(s string) (string, error)

func NoNullBytes added in v0.0.8

func NoNullBytes(s string) (string, error)

func NoWhitespace

func NoWhitespace(s string) (string, error)

func NonNegative

func NonNegative(n int) (int, error)

func NonZero

func NonZero(n int) (int, error)

func NotEmpty

func NotEmpty(s string) (string, error)

func NotEmptyList

func NotEmptyList(items []any) ([]any, error)

func Numeric

func Numeric(s string) (string, error)

func OneOf

func OneOf(s string, allowed ...string) (string, error)

func ParseBool

func ParseBool(s string) (bool, error)

func ParseFloat

func ParseFloat(s string) (float64, error)

func ParseInt

func ParseInt(s string) (int, error)

func ParsePositiveInt

func ParsePositiveInt(s string) (int, error)

func Positive

func Positive(n int) (int, error)

func PositiveFloat

func PositiveFloat(n float64) (float64, error)

func Require

func Require(s string, fieldName string) (string, error)

func SafeFilename added in v0.0.8

func SafeFilename(s string) (string, error)

func StartsWith

func StartsWith(s string, prefix string) (string, error)

func URL

func URL(s string) (string, error)

func WithMessage

func WithMessage(value string, err error, message string) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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