form

package
v0.0.0-...-d0e669d Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assign

func Assign(form interface{}, data map[string]interface{})

Assign assigns form values back to the template data.

func Bind

func Bind(model interface{}) flamego.Handler

Types

type Error

type Error struct {
	Category ErrorCategory
	Error    error
}

type ErrorCategory

type ErrorCategory string
const (
	ErrorCategoryDeserialization ErrorCategory = "deserialization"
	ErrorCategoryValidation      ErrorCategory = "validation"
)

type ForgotPassword

type ForgotPassword struct {
	Email     string `valid:"required;email;maxlen:100" label:"电子邮箱"`
	Recaptcha string `form:"g-recaptcha-response" valid:"required" label:"Recaptcha"`
}

type Login

type Login struct {
	Email     string `valid:"required;email;maxlen:100" label:"电子邮箱"`
	Password  string `valid:"required" label:"密码"`
	Recaptcha string `form:"g-recaptcha-response" valid:"required" label:"Recaptcha"`
}

type NewQuestion

type NewQuestion struct {
	Content              string `form:"content" valid:"required;maxlen:1000" label:"问题内容"`
	ReceiveReplyViaEmail string
	ReceiveReplyEmail    string                  `label:"接收回复的电子邮箱"`
	Recaptcha            string                  `` /* 129-byte string literal not displayed */
	Images               []*multipart.FileHeader `form:"images" label:"图片"`
}

type PublishAnswerQuestion

type PublishAnswerQuestion struct {
	Answer string                  `form:"answer" valid:"required;maxlen:1000" label:"回答内容"`
	Images []*multipart.FileHeader `form:"images" label:"图片"`
}

type RecoverPassword

type RecoverPassword struct {
	NewPassword    string `valid:"required;minlen:8;maxlen:30" label:"新密码"`
	RepeatPassword string `valid:"required;equal:NewPassword" label:"重复密码"`
}

type Register

type Register struct {
	Email          string `valid:"required;email;maxlen:100" label:"电子邮箱"`
	Domain         string `valid:"required;alphadash;minlen:3;maxlen:20" label:"个性域名"`
	Name           string `valid:"required;maxlen:20" label:"昵称"`
	Password       string `valid:"required;minlen:8;maxlen:30" label:"密码"`
	RepeatPassword string `valid:"required;equal:Password" label:"重复密码"`
	Recaptcha      string `` /* 129-byte string literal not displayed */
}

type UpdateAnswerQuestion

type UpdateAnswerQuestion struct {
	Answer string                  `form:"answer" valid:"required;maxlen:1000" label:"回答内容"`
	Images []*multipart.FileHeader `form:"images" label:"图片"`
}

type UpdateHarassment

type UpdateHarassment struct {
	RegisterOnly string `label:"仅允许注册用户"`
}

type UpdateProfile

type UpdateProfile struct {
	Name        string `valid:"required;maxlen:20" label:"昵称"`
	OldPassword string `label:"旧密码"`
	NewPassword string `valid:"maxlen:30" label:"新密码"`
	Intro       string `valid:"required;maxlen:100" label:"介绍"`
	NotifyEmail string `label:"开启邮箱通知"`
}

Jump to

Keyboard shortcuts

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