formvalidator

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormValidator

func FormValidator(r *http.Request, fields []string, formField FormField) (map[string]interface{}, error)

func ParseBoolFromForm

func ParseBoolFromForm(r *http.Request, fields []string) (map[string]bool, error)

func ParseDateFormForm

func ParseDateFormForm(r *http.Request, fields []string) (map[string]time.Time, error)

func ParseFloatFromForm

func ParseFloatFromForm(r *http.Request, fields []string) (map[string]float64, error)

func ParseFormData

func ParseFormData(r *http.Request) error

func ParseFromForm

func ParseFromForm[T any](r *http.Request, fields []string, converter FormField) (map[string]T, error)

func ParseIntFromForm

func ParseIntFromForm(r *http.Request, fields []string) (map[string]int, error)

func ParseNullBoolFromForm

func ParseNullBoolFromForm(r *http.Request, fields []string) (map[string]sql.NullBool, error)

func ParseNullFloat64FromForm

func ParseNullFloat64FromForm(r *http.Request, fields []string) (map[string]sql.NullFloat64, error)

func ParseNullInt32FromForm

func ParseNullInt32FromForm(r *http.Request, fields []string) (map[string]sql.NullInt32, error)

func ParseNullInt64FromForm

func ParseNullInt64FromForm(r *http.Request, fields []string) (map[string]sql.NullInt64, error)

func ParseNullStringFromForm

func ParseNullStringFromForm(r *http.Request, fields []string) (map[string]sql.NullString, error)

func ParseNullTimeFromForm

func ParseNullTimeFromForm(r *http.Request, fields []string) (map[string]sql.NullTime, error)

func ParseNullUnixTime32FromForm

func ParseNullUnixTime32FromForm(r *http.Request, fields []string) (map[string]sql.NullInt32, error)

func ParseNullUnixTimeFromForm

func ParseNullUnixTimeFromForm(r *http.Request, fields []string) (map[string]sql.NullInt64, error)

func ParseStringFromForm

func ParseStringFromForm(r *http.Request, fields []string) (map[string]string, error)

func ParseUnixTimeFromForm

func ParseUnixTimeFromForm(r *http.Request, fields []string) (map[string]int, error)

Types

type BoolFormField

type BoolFormField struct{}

func (BoolFormField) Validator

func (BoolFormField) Validator(str string) (interface{}, error)

type DateFormField

type DateFormField struct{}

func (DateFormField) Validator

func (DateFormField) Validator(str string) (interface{}, error)

type FloatFormField

type FloatFormField struct{}

func (FloatFormField) Validator

func (FloatFormField) Validator(str string) (interface{}, error)

type FormField

type FormField interface {
	Validator(string) (interface{}, error)
}

type IntFormField

type IntFormField struct{}

func (IntFormField) Validator

func (IntFormField) Validator(str string) (interface{}, error)

type NullBoolFormField

type NullBoolFormField struct{}

func (NullBoolFormField) Validator

func (c NullBoolFormField) Validator(str string) (interface{}, error)

type NullFloat64FormField

type NullFloat64FormField struct{}

func (NullFloat64FormField) Validator

func (c NullFloat64FormField) Validator(str string) (interface{}, error)

type NullInt32FormField

type NullInt32FormField struct{}

func (NullInt32FormField) Validator

func (c NullInt32FormField) Validator(str string) (interface{}, error)

type NullInt64FormField

type NullInt64FormField struct{}

func (NullInt64FormField) Validator

func (c NullInt64FormField) Validator(str string) (interface{}, error)

type NullStringFormField

type NullStringFormField struct{}

func (NullStringFormField) Validator

func (c NullStringFormField) Validator(str string) (interface{}, error)

type NullTimeFormField

type NullTimeFormField struct{}

func (NullTimeFormField) Validator

func (c NullTimeFormField) Validator(str string) (interface{}, error)

type NullUnixTimeFormField

type NullUnixTimeFormField struct{}

func (NullUnixTimeFormField) Validator

func (c NullUnixTimeFormField) Validator(str string) (interface{}, error)

type UnixTimeFormField

type UnixTimeFormField struct{}

func (UnixTimeFormField) Validator

func (UnixTimeFormField) Validator(str string) (interface{}, error)

Jump to

Keyboard shortcuts

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