valid

package
v1.9.5 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	// error code num not used at present! all code return 1
	Code int

	// the front define name
	Param string

	// RuleName current error validator name
	RuleName string

	// the struct key name if error on struct field
	Key string

	// error msg if define custom msg will used preferred
	Msg string

	// Type the error type: global error not happened on the detail field , not contain any field info, the Key and param maybe empty
	Type ErrorType

	// CauseErr the real error msg used for log
	CauseErr error
}

Error validator error support code number、filed param、filed key、

func (*Error) Error

func (e *Error) Error() string

func (*Error) Format

func (e *Error) Format(s fmt.State, verb rune)

func (*Error) Unwrap

func (e *Error) Unwrap() error

Unwrap provides compatibility for Go 1.13 error chains.

type ErrorType

type ErrorType int
const (
	ErrorTypeGlobal ErrorType = 1
	ErrorTypeField  ErrorType = 2

	CodeParamsErr = 1 // param code number
)

Jump to

Keyboard shortcuts

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