validation

package
v1.12.6 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: MIT Imports: 0 Imported by: 30

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data interface {
	Get(key string) (val any, exist bool)
	Set(key string, val any) error
}

type Errors

type Errors interface {
	One(key ...string) string
	Get(key string) map[string]string
	All() map[string]map[string]string
	Has(key string) bool
}

type Option

type Option func(map[string]any)

type Rule

type Rule interface {
	Signature() string
	Passes(data Data, val any, options ...any) bool
	Message() string
}

type Validation

type Validation interface {
	Make(data any, rules map[string]string, options ...Option) (Validator, error)
	AddRules([]Rule) error
	Rules() []Rule
}

type Validator

type Validator interface {
	Bind(ptr any) error
	Errors() Errors
	Fails() bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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