validator

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: MIT Imports: 2 Imported by: 1 module, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Messages Messages
}

type Errors added in v0.1.2

type Errors map[string][]string

type Messages

type Messages struct {
	Email     string `json:"email" toml:"email" yaml:"email"`
	Required  string `json:"required" toml:"required" yaml:"required"`
	MinText   string `json:"minText" toml:"minText" yaml:"minText"`
	MaxText   string `json:"maxText" toml:"maxText" yaml:"maxText"`
	MinNumber string `json:"minNumber" toml:"minNumber" yaml:"minNumber"`
	MaxNumber string `json:"maxNumber" toml:"maxNumber" yaml:"maxNumber"`
}

type Schema added in v0.1.2

type Schema interface {
	Add(name string) SchemaField
}

func Shape added in v0.1.2

func Shape() Schema

type SchemaField added in v0.1.1

type SchemaField interface {
	Email() SchemaField
	Required() SchemaField
	Min(min int) SchemaField
	Max(max int) SchemaField
}

func Field

func Field() SchemaField

type Validator

type Validator interface {
	Json(s Schema, data any) (bool, Errors)
}

func New

func New(config ...Config) Validator

Jump to

Keyboard shortcuts

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