models

package
v0.0.0-...-d5bef95 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2014 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Avatar90

func Avatar90(email string) string

func Notes

func Notes() orm.QuerySeter

Types

type Note

type Note struct {
	Id       int       `orm:"auto;pk" json:"id"`
	UserId   int       `orm:"column(user_id);index" json:"user_id"`
	Content  string    `orm:"size(1024)" json:"content"`
	Done     int8      `orm:"type(tinyint)" json:"done"`
	DoneAt   time.Time `orm:"null;type(datetime);column(done_at)" json:"done_at"`
	CreateAt time.Time `orm:"auto_now_add;type(datetime);column(create_at)" json:"create_at"`
}

func DoneNotes

func DoneNotes(userId int) []*Note

func TodoNotes

func TodoNotes(userId int) []*Note

func (*Note) Delete

func (this *Note) Delete() error

func (*Note) FillAttrs

func (this *Note) FillAttrs() bool

func (*Note) Insert

func (this *Note) Insert() error

func (*Note) TableEngine

func (u *Note) TableEngine() string

func (*Note) TableName

func (u *Note) TableName() string

func (*Note) Update

func (this *Note) Update(fields ...string) error

type User

type User struct {
	Id       int       `orm:"auto;pk"`
	Name     string    `orm:"size(64);unique;index"`
	Email    string    `orm:"size(64);unique;index"`
	Password string    `orm:"size(64);null"`
	Portrait string    `orm:"null"`
	Blocked  int8      `orm:"type(tinyint)"`
	CreateAt time.Time `orm:"auto_now_add;type(datetime);column(create_at)"`
}

func FindUserByEmail

func FindUserByEmail(email string) *User

func FindUserByName

func FindUserByName(name string) *User

func (*User) Delete

func (this *User) Delete() error

func (*User) FillAttrs

func (this *User) FillAttrs() bool

func (*User) Insert

func (this *User) Insert() error

func (*User) TableEngine

func (u *User) TableEngine() string

func (*User) TableName

func (u *User) TableName() string

Jump to

Keyboard shortcuts

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