models

package
v0.0.0-...-3ad0aa0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UsernameRegex = `^[a-zA-Z0-9]+$`
)

Variables

This section is empty.

Functions

func Users

func Users() orm.QuerySeter

Types

type User

type User struct {
	Id       int
	Username string    `orm:"size(30);unique"`
	Password string    `orm:"size(128)"`
	Email    string    `orm:"size(80);unique"`
	Avatar   string    `orm:"size(32)"`
	Salt     string    `orm:"size(6)"`
	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) SetPassword

func (m *User) SetPassword(password string) error

func (*User) Update

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

func (*User) ValidUsername

func (m *User) ValidUsername() (err error)

func (*User) VerifyPassword

func (m *User) VerifyPassword(password string) bool

Jump to

Keyboard shortcuts

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