validator

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2025 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolPtr

func BoolPtr(b bool) *bool

BoolPtr convert bool to *bool

func IsAudio added in v0.1.2

func IsAudio(ext string) bool

IsAudio verify is audio

func IsAudioFile added in v0.1.2

func IsAudioFile(filename string) bool

IsAudioFile checks if a file is an audio based on its name/extension

func IsContains

func IsContains(i any, j []any) bool

IsContains verify is contains

func IsDocument added in v0.1.2

func IsDocument(ext string) bool

IsDocument verify is document

func IsDocumentFile added in v0.1.2

func IsDocumentFile(filename string) bool

IsDocumentFile checks if a file is a document based on its name/extension

func IsEmailValid

func IsEmailValid(address string) bool

IsEmailValid verify email

func IsEmpty

func IsEmpty(i any) bool

IsEmpty verify is empty

func IsEqual

func IsEqual(i, j any) bool

IsEqual verify is equal

func IsFalse

func IsFalse(i any) bool

IsFalse verify is false

func IsGreater

func IsGreater(i, j any) bool

IsGreater verify is greater

func IsGreaterOrEqual

func IsGreaterOrEqual(i, j any) bool

IsGreaterOrEqual verify is greater or equal

func IsImage added in v0.1.2

func IsImage(ext string) bool

IsImage verify is image

func IsImageFile added in v0.1.2

func IsImageFile(filename string) bool

IsImageFile checks if a file is an image based on its name/extension

func IsIn

func IsIn(i any, j []any) bool

IsIn verify is in

func IsInArray

func IsInArray(i any, j []any) bool

IsInArray verify is in array

func IsInString

func IsInString(i string, j []string) bool

IsInString verify is in string

func IsLess

func IsLess(i, j any) bool

IsLess verify is less

func IsLessOrEqual

func IsLessOrEqual(i, j any) bool

IsLessOrEqual verify is less or equal

func IsNil

func IsNil(v any) bool

IsNil verify nil

func IsNotContains

func IsNotContains(i any, j []any) bool

IsNotContains verify is not contains

func IsNotEmpty

func IsNotEmpty(i any) bool

IsNotEmpty verify is not empty

func IsNotEqual

func IsNotEqual(i, j any) bool

IsNotEqual verify is not equal

func IsNotIn

func IsNotIn(i any, j []any) bool

IsNotIn verify is not in

func IsNotInString

func IsNotInString(i string, j []string) bool

IsNotInString verify is not in string

func IsNotNil

func IsNotNil(i any) bool

IsNotNil verify is not nil

func IsPhoneValid

func IsPhoneValid(phone string) bool

IsPhoneValid verify phone number

func IsTrue

func IsTrue(i any) bool

IsTrue verify is true

func IsURL

func IsURL(s string) bool

IsURL checks if a string is a valid URL.

func IsVideo added in v0.1.2

func IsVideo(ext string) bool

IsVideo verify is video

func IsVideoFile added in v0.1.2

func IsVideoFile(filename string) bool

IsVideoFile checks if a file is a video based on its name/extension

func PtrBool

func PtrBool(b *bool) bool

PtrBool convert *bool to bool

func RemoveEmptyString

func RemoveEmptyString(as []string) []string

RemoveEmptyString remove empty string of string array

func ValidateStruct

func ValidateStruct(s any, lang ...string) map[string]string

ValidateStruct validates a struct and returns a map of JSON field names to friendly error messages.

Types

This section is empty.

Jump to

Keyboard shortcuts

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