Documentation ¶
Index ¶
- Constants
- func DefineAllTables(dbm *gorp.DbMap)
- func DefineDbVersionTable(dbm *gorp.DbMap)
- func DefineLanguageTable(dbm *gorp.DbMap)
- func DefineSessionTable(dbm *gorp.DbMap)
- func DefineUserTable(dbm *gorp.DbMap)
- func InitDbVersionTable(txn *gorp.Transaction)
- func InitLanguageTable(txn *gorp.Transaction)
- type DbVersion
- type IPTypeConverter
- type Language
- type Session
- type User
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 DefineDbVersionTable ¶
func DefineLanguageTable ¶
func DefineSessionTable ¶
func DefineUserTable ¶
func InitDbVersionTable ¶
func InitDbVersionTable(txn *gorp.Transaction)
func InitLanguageTable ¶
func InitLanguageTable(txn *gorp.Transaction)
Types ¶
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 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 (*Session) ParseIpAddress ¶
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) SetPassword ¶
func (*User) ValidatePassword ¶
Click to show internal directories.
Click to hide internal directories.