Documentation
¶
Index ¶
- Variables
- func ValidFormValues(formFields []byte, values url.Values) error
- type ChoiceFilter
- type ChooseMultipleField
- type ChooseOneField
- type DropdownField
- type FieldType
- type LongTextField
- type ShortTextField
- type TinyFormField
- type TinyFormFieldPresence
- type TinyFormFields
- type VisibilityComparison
- type VisibilityCondition
- type VisibilityRule
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRequiredFieldMissing = errors.New("required field missing") ErrInvalidChoice = errors.New("invalid choice") ErrInvalidPattern = errors.New("invalid pattern") ErrInvalidLength = errors.New("invalid length") ErrInvalidEmail = errors.New("invalid email") ErrInvalidURL = errors.New("invalid URL") ErrInvalidTelephone = errors.New("invalid telephone number") ErrInvalidColor = errors.New("invalid color") ErrInvalidDate = errors.New("invalid date") ErrInvalidTime = errors.New("invalid time") ErrInvalidDateTime = errors.New("invalid date and time") ErrLineBreakNotAllowed = errors.New("line breaks not allowed") ErrInvalidFieldValue = errors.New("invalid field value") )
Functions ¶
Types ¶
type ChoiceFilter ¶
type ChooseMultipleField ¶
type ChooseMultipleField struct { Type string `json:"type"` // "ChooseMultiple" Choices []string `json:"choices"` MinRequired *int `json:"minRequired,omitempty"` MaxAllowed *int `json:"maxAllowed,omitempty"` Filter *ChoiceFilter `json:"filter,omitempty"` }
func (*ChooseMultipleField) UnmarshalJSON ¶
func (f *ChooseMultipleField) UnmarshalJSON(data []byte) error
func (*ChooseMultipleField) Validate ¶
func (f *ChooseMultipleField) Validate(value []string, field TinyFormField) error
type ChooseOneField ¶
type ChooseOneField struct { Type string `json:"type"` // "ChooseOne" Choices []string `json:"choices"` Filter *ChoiceFilter `json:"filter,omitempty"` }
func (*ChooseOneField) UnmarshalJSON ¶
func (f *ChooseOneField) UnmarshalJSON(data []byte) error
func (*ChooseOneField) Validate ¶
func (f *ChooseOneField) Validate(value []string, field TinyFormField) error
type DropdownField ¶
type DropdownField struct { Type string `json:"type"` // "Dropdown" Choices []string `json:"choices"` Filter *ChoiceFilter `json:"filter,omitempty"` }
func (*DropdownField) UnmarshalJSON ¶
func (f *DropdownField) UnmarshalJSON(data []byte) error
func (*DropdownField) Validate ¶
func (f *DropdownField) Validate(value []string, field TinyFormField) error
type FieldType ¶
type FieldType interface {
Validate(value []string, field TinyFormField) error
}
type LongTextField ¶
type LongTextField struct { Type string `json:"type"` // "LongText" MaxLength *int `json:"maxLength"` }
func (*LongTextField) Validate ¶
func (f *LongTextField) Validate(value []string, field TinyFormField) error
type ShortTextField ¶
type ShortTextField struct { Type string `json:"type"` // "ShortText" InputType string `json:"inputType"` InputTag string `json:"inputTag,omitempty"` Attributes map[string]string `json:"attributes,omitempty"` }
func (*ShortTextField) Validate ¶
func (f *ShortTextField) Validate(value []string, field TinyFormField) error
type TinyFormField ¶
type TinyFormField struct { Label string `json:"label"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Presence TinyFormFieldPresence `json:"presence,omitempty"` Type FieldType `json:"type"` VisibilityRule []VisibilityRule `json:"visibilityRule,omitempty"` }
func (TinyFormField) FieldName ¶
func (tff TinyFormField) FieldName() string
func (*TinyFormField) UnmarshalJSON ¶
func (f *TinyFormField) UnmarshalJSON(data []byte) error
type TinyFormFieldPresence ¶
type TinyFormFieldPresence struct { Type string `json:"type,omitempty"` Name string `json:"name,omitempty"` }
func (TinyFormFieldPresence) MarshalJSON ¶
func (p TinyFormFieldPresence) MarshalJSON() ([]byte, error)
func (*TinyFormFieldPresence) UnmarshalJSON ¶
func (p *TinyFormFieldPresence) UnmarshalJSON(data []byte) error
type TinyFormFields ¶
type TinyFormFields []TinyFormField
type VisibilityComparison ¶
type VisibilityCondition ¶
type VisibilityCondition struct { Type string `json:"type,omitempty"` FieldName string `json:"fieldName,omitempty"` Comparison VisibilityComparison `json:"comparison"` }
type VisibilityRule ¶
type VisibilityRule struct { Type string `json:"type"` Conditions []VisibilityCondition `json:"conditions"` }
Click to show internal directories.
Click to hide internal directories.