validator

package
v0.0.0-...-8f202a6 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RULE_OLDER_THAN  = "older_than"
	RULE_REQUIRED_IF = "required_if"
)

Variables

View Source
var Validate = validator.New()

Functions

func IsMimeTypeValid

func IsMimeTypeValid(mimeType string, allowedMimes []string) bool

func IsNPWPValid

func IsNPWPValid(npwp string) bool

func OlderThan

func OlderThan(fl validator.FieldLevel) bool

func RequiredIf

func RequiredIf(fl validator.FieldLevel) bool

Types

type ValidationError

type ValidationError struct {
	Key          string
	ErrorMessage string
}

func ParseValidationError

func ParseValidationError(errorString string) (*ValidationError, error)

ParseValidationError parses an error string and returns a ValidationError struct.

Jump to

Keyboard shortcuts

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