Documentation ¶
Index ¶
- func AppendOptions(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, ...) (validatecontract.Validator, error)
- func ValidateRequest(ctx *frame.Context, request http.FormRequest) (validatecontract.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 AppendOptions(validator *validate.Validation, options map[string]any)
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 ...validatecontract.Option) (validatecontract.Validator, error)
func ValidateRequest ¶
func ValidateRequest(ctx *frame.Context, request http.FormRequest) (validatecontract.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 []validatecontract.Rule) error
func (*Validation) Make ¶
func (r *Validation) Make(data any, rules map[string]string, options ...validatecontract.Option) (validatecontract.Validator, error)
func (*Validation) Rules ¶
func (r *Validation) Rules() []validatecontract.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.