vadutil

package
v0.0.0-...-f930341 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddBindErrors

func AddBindErrors(c *xin.Context, err error, ns string, fks ...string)

AddBindErrors translate bind or validate errors FieldBindErrors:

  1. {xxx}.error.{field}
  2. error.param.invalid

ValidationErrors:

  1. {xxx}.error.{field}.{tag}
  2. {xxx}.error.param.{tag}
  3. error.param.{tag}
  4. error.param.invalid

func ErrInvalidField

func ErrInvalidField(c *xin.Context, ns, field string) error

func ErrInvalidID

func ErrInvalidID(c *xin.Context) error

func ParseCIDRs

func ParseCIDRs(cidr string) (cidrs []*net.IPNet)

func ValidateCIDRs

func ValidateCIDRs(fl vad.FieldLevel) bool

Types

type ParamError

type ParamError struct {
	Param   string `json:"param"`
	Message string `json:"message"`
}

func (*ParamError) Error

func (pe *ParamError) Error() string

Jump to

Keyboard shortcuts

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