validation

package
v1.0.0-...-a0f063d Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: MIT Imports: 0 Imported by: 0

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
	String() string
	Has(key string) bool
}

type IValidation

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

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 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