github.com/TeaOSLab/EdgeNode@v1.3.8/internal/waf/checkpoints/option_field.go (about) 1 package checkpoints 2 3 // attach option 4 type FieldOption struct { 5 Name string 6 Code string 7 Value string // default value 8 IsRequired bool 9 Size int 10 Comment string 11 Placeholder string 12 RightLabel string 13 MaxLength int 14 Validate func(value string) (ok bool, message string) 15 } 16 17 func NewFieldOption(name string, code string) *FieldOption { 18 return &FieldOption{ 19 Name: name, 20 Code: code, 21 } 22 } 23 24 func (this *FieldOption) Type() string { 25 return "field" 26 }