validate

package module
v0.0.0-...-97492bb Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: MIT Imports: 10 Imported by: 1

README

Validate

License

Installation

Use go get.

go get github.com/go-funcards/validate

Then import validate package into your own code.

import "github.com/go-funcards/validate"

License

Distributed under MIT License, please see license file within the code for more details.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = new(Validator)

Functions

func DefaultValidatorStreamServerInterceptor

func DefaultValidatorStreamServerInterceptor() grpc.StreamServerInterceptor

func DefaultValidatorUnaryServerInterceptor

func DefaultValidatorUnaryServerInterceptor() grpc.UnaryServerInterceptor

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