Package validate
import "gitlab.hexacode.org/go-libs/microservice/validate"
- Overview
- Index
type Options struct {
Name string `json:"name,omitempty"`
Label string `json:"label,omitempty"`
Placeholder string `json:"placeholder,omitempty"`
Type string `json:"type,omitempty"`
Required bool `json:"required,omitempty"`
Regex string `json:"regex,omitempty"`
Min int `json:"min,omitempty"`
Max int `json:"max,omitempty"`
MinFloat float32 `json:"min_float,omitempty"`
MaxFloat float32 `json:"max_float,omitempty"`
Children []*Options `json:"children,omitempty"`
ValueText string `json:"value_text,omitempty"`
ValueNumber int64 `json:"value_number,omitempty"`
ValueFloat float32 `json:"value_float,omitempty"`
ValueDouble float64 `json:"value_double,omitempty"`
}
func (options *Options) ValidDouble() error
func (options *Options) ValidEmail() error
func (options *Options) ValidFload() error
func (options *Options) ValidName() error
func (options *Options) ValidNumber() error
func (options *Options) ValidPassword() error
func (options *Options) ValidPhone() error
func (options *Options) ValidText() error
func (options *Options) ValidTextNumber() error
func (options *Options) ValidUsername() error
func (options *Options) Validate(value interface{}) *ValidateError
type ValidateError struct {
Name string `json:"name,omitempty"`
Message string `json:"message,omitempty"`
Value interface{} `json:"value,omitempty"`
Children []*ValidateError `json:"children,omitempty"`
}
func Validate(optionses []*Options, values hctypes.Dict) []*ValidateError