models

package
v0.0.0-...-5815414 Latest Latest
Warning

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

Go to latest
Published: May 16, 2015 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValid

func IsValid(model interface{}) (err error)

Get form error

func Users

func Users() orm.QuerySeter

Types

type User

type User struct {
	Id            int64
	Email         string    `orm:"size(64);unique" form:"Email" valid:"Required;Email"`
	Password      string    `orm:"size(32)" form:"Password" valid:"Required;MinSize(6)"`
	Repassword    string    `orm:"-" form:"Repassword" valid:"Required"`
	Lastlogintime time.Time `orm:"type(datetime);null" form:"-"`
	Created       time.Time `orm:"auto_now_add;type(datetime)"`
	Updated       time.Time `orm:"auto_now;type(datetime)"`
}

func (*User) Delete

func (m *User) Delete() error

func (*User) Insert

func (m *User) Insert() error

func (*User) Read

func (m *User) Read(fields ...string) error

func (*User) ReadOrCreate

func (m *User) ReadOrCreate(field string, fields ...string) (bool, int64, error)

func (*User) Update

func (m *User) Update(fields ...string) error

func (*User) Valid

func (u *User) Valid(v *validation.Validation)

Jump to

Keyboard shortcuts

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