options

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checkbox added in v0.0.2

type Checkbox struct {
	Option

	IsChecked bool   `yaml:"isChecked" json:"isChecked"`
	Label     string `yaml:"label" json:"label"`
}

func NewCheckbox added in v0.0.2

func NewCheckbox(title string, code string) *Checkbox

func (*Checkbox) ApplyRequest added in v0.0.2

func (this *Checkbox) ApplyRequest(req *http.Request) (value interface{}, skip bool, err error)

type Option

type Option struct {
	Type        string            `yaml:"type" json:"type"` // option type, such as "bool", "string" ...
	Attrs       map[string]string `yaml:"attrs" json:"attrs"`
	Title       string            `yaml:"title" json:"title"`
	Subtitle    string            `yaml:"subtitle" json:"subtitle"`
	Code        string            `yaml:"code" json:"code"`
	Description string            `yaml:"description" json:"description"`
	IsRequired  bool              `yaml:"isRequired" json:"isRequired"`
	Value       interface{}       `yaml:"value" json:"value"`
}

func (*Option) Attr

func (this *Option) Attr(name string, value string)

func (*Option) BasicOption

func (this *Option) BasicOption() *Option

type OptionInterface

type OptionInterface interface {
	BasicOption() *Option
	ApplyRequest(req *http.Request) (value interface{}, skip bool, err error)
}

type Options

type Options struct {
	Option

	Values []*TextValue `yaml:"values" json:"values"`
}

func NewOptions

func NewOptions(title string, code string) *Options

func (*Options) AddValue

func (this *Options) AddValue(text string, value string)

func (*Options) ApplyRequest

func (this *Options) ApplyRequest(req *http.Request) (value interface{}, skip bool, err error)

type TextBox added in v0.0.2

type TextBox struct {
	Option

	MaxLength   int    `yaml:"maxLength" json:"maxLength"`
	Placeholder string `yaml:"placeholder" json:"placeholder"`
	Cols        int    `yaml:"cols" json:"cols"`
	Rows        int    `yaml:"rows" json:"rows"`
}

func NewTextBox added in v0.0.2

func NewTextBox(title string, code string) *TextBox

func (*TextBox) ApplyRequest added in v0.0.2

func (this *TextBox) ApplyRequest(req *http.Request) (value interface{}, skip bool, err error)

type TextField added in v0.0.2

type TextField struct {
	Option `yaml:",inline"`

	MaxLength   int    `yaml:"maxLength" json:"maxLength"`
	Placeholder string `yaml:"placeholder" json:"placeholder"`
	Size        int    `yaml:"size" json:"size"`
	RightLabel  string `yaml:"rightLabel" json:"rightLabel"`
}

func NewTextField added in v0.0.2

func NewTextField(title string, code string) *TextField

func (*TextField) ApplyRequest added in v0.0.2

func (this *TextField) ApplyRequest(req *http.Request) (value interface{}, skip bool, err error)

type TextValue

type TextValue struct {
	Text  string `yaml:"text" json:"text"`
	Value string `yaml:"value" json:"value"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址