models

package
v0.0.0-...-f6de6f3 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2015 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HashPrefix = ":B:"
)

Variables

This section is empty.

Functions

func ExtractHashAndSalt

func ExtractHashAndSalt(hash string) (string, string)

func HashPassword

func HashPassword(password string, salt string) string

func OldHashPassword

func OldHashPassword(password string, userId int64) string

Types

type StorageFactory

type StorageFactory struct {
	// contains filtered or unexported fields
}

func NewStorageFactory

func NewStorageFactory(dbConfig *config.DbConfig) *StorageFactory

func (*StorageFactory) Close

func (storageFactory *StorageFactory) Close()

func (*StorageFactory) GetStoragePinger

func (storageFactory *StorageFactory) GetStoragePinger() *StoragePinger

func (*StorageFactory) GetUserStorage

func (storageFactory *StorageFactory) GetUserStorage() *UserStorage

type StoragePinger

type StoragePinger struct {
	// contains filtered or unexported fields
}

func NewStoragePinger

func NewStoragePinger(dbmapMaster *gorp.DbMap, dbmapSlave *gorp.DbMap) *StoragePinger

func (*StoragePinger) PingMaster

func (storagePinger *StoragePinger) PingMaster() error

func (*StoragePinger) PingSlave

func (storagePinger *StoragePinger) PingSlave() error

type User

type User struct {
	Id                 int64      `db:"user_id"`
	Name               string     `db:"user_name"`
	RealName           string     `db:"user_real_name"`
	Password           string     `db:"-"`
	HashedPassword     string     `db:"user_password"`
	NewPassword        string     `db:"user_newpassword"`
	NewPassTime        *string    `db:"user_newpass_time"`
	Email              string     `db:"user_email"`
	Touched            string     `db:"user_touched"`
	Token              string     `db:"user_token"`
	EmailAuthenticated *string    `db:"user_email_authenticated"`
	EmailToken         *string    `db:"user_email_token"`
	EmailTokenExpires  *string    `db:"user_email_token_expires"`
	Registration       *string    `db:"user_registration"`
	EditCount          *int64     `db:"user_editcount"`
	BirthDate          *time.Time `db:"user_birthdate"`
	Options            []byte     `db:"user_options"`
}

func (*User) IsValidPassword

func (user *User) IsValidPassword(password string) bool

type UserStorage

type UserStorage struct {
	// contains filtered or unexported fields
}

func NewUserStorage

func NewUserStorage(dbmapMaster *gorp.DbMap, dbmapSlave *gorp.DbMap) *UserStorage

func (*UserStorage) FindByName

func (userStorage *UserStorage) FindByName(userName string, mustExist bool) (*User, error)

Jump to

Keyboard shortcuts

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