models

package
v0.0.0-...-a2d740a Latest Latest
Warning

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

Go to latest
Published: May 9, 2015 License: GPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_HASHING_COST  = 15
	DEFAULT_BCRYPT_STRLEN = 44
)
View Source
const (
	CURRENT_DB_VERSION = "0.1"
)

Variables

This section is empty.

Functions

func DefineAllTables

func DefineAllTables(dbm *gorp.DbMap)

func DefineDbVersionTable

func DefineDbVersionTable(dbm *gorp.DbMap)

func DefineLanguageTable

func DefineLanguageTable(dbm *gorp.DbMap)

func DefineSessionTable

func DefineSessionTable(dbm *gorp.DbMap)

func DefineUserTable

func DefineUserTable(dbm *gorp.DbMap)

func InitDbVersionTable

func InitDbVersionTable(txn *gorp.Transaction)

func InitLanguageTable

func InitLanguageTable(txn *gorp.Transaction)

Types

type DbVersion

type DbVersion struct {
	Value string `db:"value" json:"value"`
}

type IPTypeConverter

type IPTypeConverter struct{}

func (IPTypeConverter) FromDb

func (self IPTypeConverter) FromDb(target interface{}) (gorp.CustomScanner, bool)

func (IPTypeConverter) ToDb

func (self IPTypeConverter) ToDb(val interface{}) (interface{}, error)

type Language

type Language struct {
	Id   int64  `db:"id" json:"id"`
	Code string `db:"code" json:"code"`
	Name string `db:"name" json:"name"`
}

type Session

type Session struct {
	Id         int64     `db:"id" json:"id"`
	UserId     int64     `db:"user" json:"-"`
	AuthToken  string    `db:"auth_token" json:"authToken"`
	IpAddress  *string   `db:"ipaddress" json:"ipAddress"`
	Ip6Address *string   `db:"ip6address" json:"ip6Address"`
	CreatedAt  time.Time `db:"created_at" json:"createdAt"`
	UpdatedAt  time.Time `db:"updated_at" json:"updatedAt"`

	User *User `db:"-" json:"user"`
}

func (*Session) ParseIp6Address

func (self *Session) ParseIp6Address() net.IP

func (*Session) ParseIpAddress

func (self *Session) ParseIpAddress() net.IP

type User

type User struct {
	Id         int64   `db:"id" json:"id"`
	User       string  `db:"user" json:"user"`
	Password   string  `db:"password" json:"password"`
	Email      *string `db:"email" json:"email"`
	Name       string  `db:"name" json:"name"`
	IsAdmin    bool    `db:"is_admin" json:"isAdmin"`
	IsLdap     bool    `db:"is_ldap" json:"isLdap"`
	LanguageId int64   `db:"language" json:"-"`
	Version    int64   `db:"version" json:"version"`

	Language *Language `db:"-" json:"language"`
}

func (*User) PostGet

func (u *User) PostGet(exe gorp.SqlExecutor) error

func (*User) PreInsert

func (u *User) PreInsert(_ gorp.SqlExecutor) error

func (*User) SetPassword

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

func (*User) ValidatePassword

func (u *User) ValidatePassword(password string) bool

Jump to

Keyboard shortcuts

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