github.com/TeaOSLab/EdgeNode@v1.3.8/internal/waf/checkpoints/option_options.go (about)

     1  package checkpoints
     2  
     3  import "github.com/iwind/TeaGo/maps"
     4  
     5  type OptionsOption struct {
     6  	Name       string
     7  	Code       string
     8  	Value      string // default value
     9  	IsRequired bool
    10  	Size       int
    11  	Comment    string
    12  	RightLabel string
    13  	Validate   func(value string) (ok bool, message string)
    14  	Options    []maps.Map
    15  }
    16  
    17  func NewOptionsOption(name string, code string) *OptionsOption {
    18  	return &OptionsOption{
    19  		Name: name,
    20  		Code: code,
    21  	}
    22  }
    23  
    24  func (this *OptionsOption) Type() string {
    25  	return "options"
    26  }
    27  
    28  func (this *OptionsOption) SetOptions(options []maps.Map) {
    29  	this.Options = options
    30  }