cValidator

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Component = &ValidatorComponent{}
View Source
var Verifier *validator.Validate

Functions

func Validate

func Validate(ctx *gin.Context, validators []*Validator, data any) (err error)

Types

type Validator

type Validator struct {
	App   string
	Name  string
	Scene string
}

type ValidatorComponent added in v0.3.2

type ValidatorComponent struct{}

func (*ValidatorComponent) Inject added in v0.3.2

func (i *ValidatorComponent) Inject(instance any) bool

func (*ValidatorComponent) InjectConf added in v0.4.0

func (i *ValidatorComponent) InjectConf(config cComponents.ConfigInterface) bool

func (*ValidatorComponent) Listen added in v0.4.0

func (*ValidatorComponent) Load added in v0.3.2

func (i *ValidatorComponent) Load()

type ValidatorContainer

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

func (*ValidatorContainer) Get

func (i *ValidatorContainer) Get(name string) any

func (*ValidatorContainer) Is added in v0.4.0

func (i *ValidatorContainer) Is(instance any) bool

func (*ValidatorContainer) Range added in v0.4.0

func (i *ValidatorContainer) Range(f func(instance any))

func (*ValidatorContainer) Remove added in v0.4.0

func (i *ValidatorContainer) Remove(name string) bool

func (*ValidatorContainer) Save

func (i *ValidatorContainer) Save(instance any) bool

type ValidatorInterface

type ValidatorInterface interface {
	ValidatorName() (app, name string)
	Rules() map[string][]*ValidatorRule
}

type ValidatorRule

type ValidatorRule struct {
	Field string
	Rules string
}

Jump to

Keyboard shortcuts

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