safe_validator

package
v1.2.33 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Tag
	// tag scope to valid struct field
	// `tag:"k1:v1;k2:v2;k3:v3"`
	Tag string

	// OnErrorStop
	// stop check immediately when tag error or valid error
	// return false when call Any, Array, Map, Slice, Struct
	// return error when call Any, ArrayE, MapE, SliceE, StructE
	OnErrorStop bool

	// IgnoreTagError
	// skip check field when tag format error, raise no error
	IgnoreTagError bool

	// IndirectValue
	// can apply field tag validator to pointer,any value
	IndirectValue bool

	// AllowEmbedStruct
	AllowEmbedStruct bool

	// AllowUnexported
	AllowUnexported bool

	// FloatPrecision
	// set default precision by -1
	// for example: set 6 is after point six bit
	FloatPrecision int
	// contains filtered or unexported fields
}

func Default

func Default() *Config

func Strict

func Strict() *Config

func (*Config) Any

func (cfg *Config) Any(v any) bool

func (*Config) AnyE

func (cfg *Config) AnyE(v any) error

func (*Config) Array

func (cfg *Config) Array(v any, tag ...string) bool

func (*Config) ArrayE

func (cfg *Config) ArrayE(v any, tag ...string) error

func (*Config) Load

func (cfg *Config) Load() *Config

func (*Config) Map

func (cfg *Config) Map(v any) bool

func (*Config) MapE

func (cfg *Config) MapE(v any) error

func (*Config) Slice

func (cfg *Config) Slice(v any) bool

func (*Config) SliceE

func (cfg *Config) SliceE(v any) error

func (*Config) Struct

func (cfg *Config) Struct(v any) bool

Struct compatible with fiber.StructValidator

func (*Config) StructE

func (cfg *Config) StructE(v any) error

func (*Config) Validate added in v1.2.30

func (cfg *Config) Validate(out any) error

Validate compatible with fiber.StructValidator

Jump to

Keyboard shortcuts

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