validate

package
v0.0.0-...-b797f85 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2022 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = new(Validator)

Functions

func ValidatorStreamServerInterceptor

func ValidatorStreamServerInterceptor(v *Validator) grpc.StreamServerInterceptor

func ValidatorUnaryServerInterceptor

func ValidatorUnaryServerInterceptor(v *Validator) grpc.UnaryServerInterceptor

Types

type Rules

type Rules map[string]string

type SliceValidateError

type SliceValidateError []error

func (SliceValidateError) Error

func (err SliceValidateError) Error() string

type TypeRules

type TypeRules map[string]Rules

type Validator

type Validator struct {
	// contains filtered or unexported fields
}

func (*Validator) Engine

func (v *Validator) Engine() any

Engine returns the underlying validator engine which powers the default

func (*Validator) RegisterStructRules

func (v *Validator) RegisterStructRules(typeRules TypeRules, types ...any)

func (*Validator) ValidateExcept

func (v *Validator) ValidateExcept(obj any, fields ...string) error

func (*Validator) ValidateStruct

func (v *Validator) ValidateStruct(obj any) error

ValidateStruct receives any kind of type, but only performed struct or pointer to struct type.

Jump to

Keyboard shortcuts

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