Documentation ¶
Overview ¶
Package database implements postgres connection, schema, and migration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetConnection ¶
GetConnection returns an existing connection, otherwise opens a new one.
func IsRecordNotFoundError ¶
IsRecordNotFoundError returns true if error contains a RecordNotFound error.
Types ¶
type Role ¶
type Role struct { gorm.Model Role string `gorm:"type:varchar(32);unique_index;not null"` Permissions string }
Role details.
type TokenRevocation ¶
type TokenRevocation struct { gorm.Model UserID uint `gorm:"not null"` RefreshToken string RevokeAllBefore time.Time }
TokenRevocation details.
type User ¶
type User struct { gorm.Model RoleID uint `gorm:"not null"` Email string `gorm:"type:varchar(128);unique_index;not null"` Username string `gorm:"type:varchar(40);unique_index;not null"` Password string `gorm:"type:varchar(60);not null"` FirstName string `gorm:"type:varchar(32);not null"` LastName string `gorm:"type:varchar(32);not null"` IsConfirmedEmail bool `gorm:"not null;default:false"` IsActive bool `gorm:"not null;default:true"` ConfirmEmailToken string ConfirmEmailTokenExpires time.Time ResetPassToken string ResetPassTokenExpires time.Time LastSignin time.Time FailedSignin time.Time }
User details.
Click to show internal directories.
Click to hide internal directories.