Documentation ¶
Index ¶
- func AppendOptions(ctx *frame.Context, validator *validate.Validation, options map[string]any)
- func Attributes(attributes map[string]string) httpvalidate.Option
- func CustomRules(rules []httpvalidate.Rule) httpvalidate.Option
- func GenerateOptions(options []httpvalidate.Option) map[string]any
- func Messages(messages map[string]string) httpvalidate.Option
- func PrepareForValidation(prepare func(data httpvalidate.Data)) httpvalidate.Option
- func Rules(rules map[string]string) httpvalidate.Option
- func Validate(ctx *frame.Context, rules map[string]string, options ...validation.Option) (validation.Validator, error)
- func ValidateRequest(ctx *frame.Context, request http.FormRequest) (validation.Errors, error)
- type Data
- type Errors
- type ServiceProvider
- type Validation
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendOptions ¶
func Attributes ¶
func Attributes(attributes map[string]string) httpvalidate.Option
func CustomRules ¶
func CustomRules(rules []httpvalidate.Rule) httpvalidate.Option
func GenerateOptions ¶
func GenerateOptions(options []httpvalidate.Option) map[string]any
func PrepareForValidation ¶
func PrepareForValidation(prepare func(data httpvalidate.Data)) httpvalidate.Option
func Validate ¶
func Validate(ctx *frame.Context, rules map[string]string, options ...validation.Option) (validation.Validator, error)
func ValidateRequest ¶
func ValidateRequest(ctx *frame.Context, request http.FormRequest) (validation.Errors, error)
Types ¶
type ServiceProvider ¶
type ServiceProvider struct { }
func (*ServiceProvider) Boot ¶
func (database *ServiceProvider) Boot()
func (*ServiceProvider) Register ¶
func (database *ServiceProvider) Register()
type Validation ¶
type Validation struct {
// contains filtered or unexported fields
}
func NewValidation ¶
func NewValidation() *Validation
func (*Validation) AddRules ¶
func (r *Validation) AddRules(rules []validation.Rule) error
func (*Validation) Make ¶
func (r *Validation) Make(ctx *frame.Context, data any, rules map[string]string, options ...validation.Option) (validation.Validator, error)
func (*Validation) Rules ¶
func (r *Validation) Rules() []validation.Rule
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
func NewValidator ¶
func NewValidator(instance *validate.Validation, data validate.DataFace) *Validator
func (*Validator) Errors ¶
func (v *Validator) Errors() httpvalidate.Errors
Source Files ¶
Click to show internal directories.
Click to hide internal directories.