Documentation ¶
Index ¶
- Variables
- func AddChoiceByKV(field fields.FieldInterface, kvData *echo.KVData, checkedKeys ...string) fields.FieldInterface
- func ClearCache()
- func DelCachedConfig(file string) bool
- func SetChoiceByKV(field fields.FieldInterface, kvData *echo.KVData, checkedKeys ...string) fields.FieldInterface
- type FormBuilder
- func (f *FormBuilder) DefaultValue(fieldName string) string
- func (f *FormBuilder) DefaultValues() map[string]string
- func (f *FormBuilder) Error() error
- func (f *FormBuilder) Exit(exit ...bool) *FormBuilder
- func (f *FormBuilder) Exited() bool
- func (f *FormBuilder) Generate() *FormBuilder
- func (f *FormBuilder) HasError() bool
- func (f *FormBuilder) Off(methods ...string) *FormBuilder
- func (f *FormBuilder) OffAll() *FormBuilder
- func (f *FormBuilder) On(method string, funcs ...MethodHook) *FormBuilder
- func (f *FormBuilder) OnConnect(funcs ...MethodHook) *FormBuilder
- func (f *FormBuilder) OnDelete(funcs ...MethodHook) *FormBuilder
- func (f *FormBuilder) OnGet(funcs ...MethodHook) *FormBuilder
- func (f *FormBuilder) OnGlobal(funcs ...MethodHook) *FormBuilder
- func (f *FormBuilder) OnHead(funcs ...MethodHook) *FormBuilder
- func (f *FormBuilder) OnOptions(funcs ...MethodHook) *FormBuilder
- func (f *FormBuilder) OnPatch(funcs ...MethodHook) *FormBuilder
- func (f *FormBuilder) OnPost(funcs ...MethodHook) *FormBuilder
- func (f *FormBuilder) OnPut(funcs ...MethodHook) *FormBuilder
- func (f *FormBuilder) OnTrace(funcs ...MethodHook) *FormBuilder
- func (f *FormBuilder) ParseConfigFile(jsonformat ...bool) error
- func (f *FormBuilder) RecvSubmission() error
- func (f *FormBuilder) SetError(err error) *FormBuilder
- func (f *FormBuilder) Snippet() *FormBuilder
- type MethodHook
- type MethodHooks
- type Option
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrJSONConfigFileNameInvalid = errors.New("*.form.json name invalid")
)
Functions ¶
func AddChoiceByKV ¶
func AddChoiceByKV(field fields.FieldInterface, kvData *echo.KVData, checkedKeys ...string) fields.FieldInterface
func ClearCache ¶
func ClearCache()
func DelCachedConfig ¶
func SetChoiceByKV ¶
func SetChoiceByKV(field fields.FieldInterface, kvData *echo.KVData, checkedKeys ...string) fields.FieldInterface
Types ¶
type FormBuilder ¶
FormBuilder HTML表单构建器
func (*FormBuilder) DefaultValue ¶
func (f *FormBuilder) DefaultValue(fieldName string) string
DefaultValue 查询某个结构体字段在数据库中对应的默认值
func (*FormBuilder) DefaultValues ¶
func (f *FormBuilder) DefaultValues() map[string]string
DefaultValues 获取model结构体各个字段在数据库中的默认值
func (*FormBuilder) Exited ¶
func (f *FormBuilder) Exited() bool
Exited 是否需要退出后续处理。此时一般有err值,用于记录错误原因
func (*FormBuilder) On ¶
func (f *FormBuilder) On(method string, funcs ...MethodHook) *FormBuilder
On 注册事件
func (*FormBuilder) OnConnect ¶
func (f *FormBuilder) OnConnect(funcs ...MethodHook) *FormBuilder
func (*FormBuilder) OnDelete ¶
func (f *FormBuilder) OnDelete(funcs ...MethodHook) *FormBuilder
func (*FormBuilder) OnGet ¶
func (f *FormBuilder) OnGet(funcs ...MethodHook) *FormBuilder
func (*FormBuilder) OnGlobal ¶
func (f *FormBuilder) OnGlobal(funcs ...MethodHook) *FormBuilder
func (*FormBuilder) OnHead ¶
func (f *FormBuilder) OnHead(funcs ...MethodHook) *FormBuilder
func (*FormBuilder) OnOptions ¶
func (f *FormBuilder) OnOptions(funcs ...MethodHook) *FormBuilder
func (*FormBuilder) OnPatch ¶
func (f *FormBuilder) OnPatch(funcs ...MethodHook) *FormBuilder
func (*FormBuilder) OnPost ¶
func (f *FormBuilder) OnPost(funcs ...MethodHook) *FormBuilder
func (*FormBuilder) OnPut ¶
func (f *FormBuilder) OnPut(funcs ...MethodHook) *FormBuilder
func (*FormBuilder) OnTrace ¶
func (f *FormBuilder) OnTrace(funcs ...MethodHook) *FormBuilder
func (*FormBuilder) ParseConfigFile ¶
func (f *FormBuilder) ParseConfigFile(jsonformat ...bool) error
ParseConfigFile 解析配置文件 xxx.form.json
func (*FormBuilder) RecvSubmission ¶
func (f *FormBuilder) RecvSubmission() error
RecvSubmission 接收客户端的提交
type MethodHook ¶
type MethodHook func() error
func BindModel ¶
func BindModel(form *FormBuilder) MethodHook
func ValidModel ¶
func ValidModel(form *FormBuilder) MethodHook
type MethodHooks ¶
type MethodHooks map[string][]MethodHook
func (MethodHooks) Fire ¶
func (hooks MethodHooks) Fire(method string) error
func (MethodHooks) Off ¶
func (hooks MethodHooks) Off(methods ...string)
func (MethodHooks) OffAll ¶
func (hooks MethodHooks) OffAll()
func (MethodHooks) On ¶
func (hooks MethodHooks) On(method string, funcs ...MethodHook)
type Option ¶
type Option func(*FormBuilder)
func ConfigFile ¶
ConfigFile 指定要解析的配置文件。如果silent=true则仅仅设置配置文件而不解析
Click to show internal directories.
Click to hide internal directories.