form

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2018 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 assign form values back to the template data.

Types

type Form

type Form interface {
	binding.Validator
}

Form interface

type Gitxt

type Gitxt struct {
	Description string `binding:"MaxSize(255)"`
	IsPublic    bool   `binding:"Default:1"`
	// Validation builtin into Macaron/Binding doesn't validates theses slices
	// See the router view for manual validation
	FilesFilename []string `binding:"Required;MaxSize(255);MinSizeSlice(1)"`
	FilesContent  []string `binding:"Required;MaxSize(255);MinSizeSlice(1)"`

	//				     no, 1h, 4h, 1d, 2d, 3d, 4d, 5d,  6d,  7d,  1m,  1y
	ExpiryHours int64 `binding:"In(0,1,4,24,48,72,96,120,144,168,730,8760);Default(0)"`
}

Gitxt form struct

func (*Gitxt) Validate

func (f *Gitxt) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors

Validate func

type GitxtDelete

type GitxtDelete struct {
	Hash  string `binding:"Required"`
	Owner string `binding:"Required"`
}

GitxtDelete form

func (*GitxtDelete) Validate

func (f *GitxtDelete) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors

Validate func

type GitxtEdit

type GitxtEdit struct {
	Description string `binding:"MaxSize(255)"`
	// Validation builtin into Macaron/Binding doesn't validates theses slices
	// See the router view for manual validation
	FilesFilename   []string `binding:"Required;MaxSize(255);MinSizeSlice(1)"`
	FilesContent    []string `binding:"Required;MaxSize(255);MinSizeSlice(1)"`
	FilesNotHandled []bool

	//				     no, 1h, 4h, 1d, 2d, 3d, 4d, 5d,  6d,  7d,  1m,  1y
	ExpiryHours int64 `binding:"In(0,1,4,24,48,72,96,120,144,168,730,8760);Default(0)"`
}

GitxtEdit form

func (*GitxtEdit) Validate

func (f *GitxtEdit) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors

Validate struct

type Login

type Login struct {
	UserName string `binding:"Required;MaxSize(254)"`
	Password string `binding:"Required;MaxSize(255)"`
	Remember bool
}

Login form

func (*Login) Validate

func (f *Login) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors

Validate func

type Register

type Register struct {
	UserName string `binding:"Required;AlphaDashDot;MaxSize(35)"`
	Email    string `binding:"Required;Email;MaxSize(254)"`
	Password string `binding:"Required;MaxSize(255)"`
	Repeat   string
}

Register form

func (*Register) Validate

func (f *Register) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors

Validate func

type UpdateSettingsProfile

type UpdateSettingsProfile struct {
	Email string `binding:"Required;Email;MaxSize(254)"`
}

UpdateSettingsProfile form struct

func (*UpdateSettingsProfile) Validate

func (f *UpdateSettingsProfile) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors

Validate func

Jump to

Keyboard shortcuts

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