validate

package
v1.21.6 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitValidator

func InitValidator(db *gorm.DB)

Types

type Validator

type Validator struct {
	Validator  *validator.Validate
	Translator ut.Translator
	// contains filtered or unexported fields
}

func Get

func Get() *Validator

Deprecated 尽量将依赖内置进入需要依赖的结构体内,避免在业务函数中直接引用外部依赖

func NewValidator

func NewValidator(db *gorm.DB) (*Validator, error)

func (*Validator) EnvironmentUserRelStructLevelValidation

func (v *Validator) EnvironmentUserRelStructLevelValidation(sl validator.StructLevel)

func (*Validator) ProjectStructLevelValidation

func (v *Validator) ProjectStructLevelValidation(sl validator.StructLevel)

func (*Validator) TenantStructLevelValidation

func (v *Validator) TenantStructLevelValidation(sl validator.StructLevel)

func (*Validator) TenantUserRelStructLevelValidation

func (v *Validator) TenantUserRelStructLevelValidation(sl validator.StructLevel)

func (*Validator) UserCreateStructLevelValidation

func (v *Validator) UserCreateStructLevelValidation(sl validator.StructLevel)

func (*Validator) UserStructLevelValidation

func (v *Validator) UserStructLevelValidation(sl validator.StructLevel)

Jump to

Keyboard shortcuts

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