validation

package
v1.0.97 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: MIT Imports: 1 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
	Has(key string) bool
}

type Option

type Option func(map[string]any)

type Rule

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

type Validation

type Validation interface {
	Make(ctx *frame.Context, 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
}

Jump to

Keyboard shortcuts

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