Documentation ¶
Index ¶
- Constants
- Variables
- func Check(fn reflect.Value, args ...interface{}) (bool, error)
- func Filter(fn reflect.Value, args ...interface{}) interface{}
- func ForkError(err string) *forkError
- func NewFilterTime(format string) func(string) string
- func NewProcessor(w Widget, v Validater, f Filterer) *processor
- func ValidEmail(t *textField) error
- func Validate(fn reflect.Value, args ...interface{}) error
- func ValidateIndex(f *formField) error
- func ValidateTime(t *timeField) error
- func ValidateXsrf(x *xsrf) error
- func WithOptions(base string, options ...string) string
- type Checker
- type Creator
- type Field
- func BooleanField(name string, label string, start bool, options ...string) Field
- func CheckboxInput(name string, label string, value string, checked bool, options ...string) Field
- func DateField(name string, options ...string) Field
- func EmailField(name string, v []interface{}, f []interface{}, options ...string) Field
- func FormField(name string, f Form) Field
- func FormsField(name string, startwith int, start Form) Field
- func HiddenField(name string, v []interface{}, f []interface{}, options ...string) Field
- func ListField(name string, startwith int, starting Field, options ...string) Field
- func PassWordField(name string, v []interface{}, f []interface{}, options ...string) Field
- func RadioField(name string, legend string, s []*Selection, v []interface{}, f []interface{}, ...) Field
- func RadioInput(name string, label string, value string, checked bool, options ...string) Field
- func SelectField(name string, s []*Selection, v []interface{}, f []interface{}, ...) Field
- func SubmitField(name string, v []interface{}, f []interface{}, options ...string) Field
- func TextAreaField(name string, v []interface{}, f []interface{}, options ...string) Field
- func TextField(name string, v []interface{}, f []interface{}, options ...string) Field
- func TimeField(name string, format string, widget Widget, v []interface{}, f []interface{}) Field
- func ToggleInput(name string, label string, value string, widget Widget, checked bool) Field
- func XSRF(name string, secret string) Field
- type FieldIndex
- type Filterer
- type Form
- type FormConfig
- type Former
- type Informer
- type Named
- type Processor
- type Renderer
- type Selection
- type Tagged
- type Validater
- type Value
- type Widget
Constants ¶
View Source
const Timeout = 12 * time.Hour
Variables ¶
View Source
var BadCheck = ForkError(`check function did not return a boolean value with its error.`)
View Source
var InvalidFunction = ForkError(`cannot use function %q with %d results, return must be %s`).Out
View Source
var NotAFunction = ForkError(`#+v is not a function`).Out
View Source
var UnassignableArg = ForkError(`arg %d has type %s; should be %s`).Out
View Source
var WrongNumberArgs = ForkError(`wrong number of args: got %d want at least %d`).Out
Functions ¶
func NewFilterTime ¶
func NewProcessor ¶
func ValidEmail ¶
func ValidEmail(t *textField) error
func ValidateIndex ¶
func ValidateIndex(f *formField) error
func ValidateTime ¶
func ValidateTime(t *timeField) error
func ValidateXsrf ¶
func ValidateXsrf(x *xsrf) error
func WithOptions ¶
Types ¶
type Checker ¶
type Checker interface { Checkable() bool SetCheckable(bool) bool Check(Form) (bool, error) Ok(Form) bool Error(f Form) bool Errors(f Form) []string Checks(...interface{}) []reflect.Value }
func NewChecker ¶
func NewChecker(c ...interface{}) Checker
type Creator ¶
type Creator interface { New() Form Configure(...FormConfig) error }
type Field ¶
func BooleanField ¶
func CheckboxInput ¶
func EmailField ¶
func HiddenField ¶
func PassWordField ¶
func RadioField ¶
func RadioInput ¶
func SelectField ¶
func SubmitField ¶
func TextAreaField ¶
func ToggleInput ¶
type FieldIndex ¶
func FilterIndex ¶
func FilterIndex(index string) *FieldIndex
func NewFieldIndex ¶
func NewFieldIndex(s string, i int) *FieldIndex
type Filterer ¶
type Filterer interface { Filter(string, *http.Request) *Value Filters(...interface{}) []reflect.Value }
func NewFilterer ¶
func NewFilterer(f ...interface{}) Filterer
type FormConfig ¶
func Checks ¶
func Checks(cs ...interface{}) FormConfig
func Fields ¶
func Fields(fs ...Field) FormConfig
type Validater ¶
type Validater interface { Validateable() bool SetValidateable(bool) bool Validate(Field) error Valid(Field) bool Error(Field) bool Errors(Field) []string Validaters(...interface{}) []reflect.Value }
func NewValidater ¶
func NewValidater(v ...interface{}) Validater
Click to show internal directories.
Click to hide internal directories.